Skip to main content

Advanced Configuration

Transfer Learning provides extensive configuration options to customize its behavior for your specific needs. This guide covers all available configuration options and how to use them.

Configuration Methods

There are several ways to configure Transfer Learning:

Environment Variables

Set environment variables directly in your shell or in a .env file

CLI Options

Pass options directly to CLI commands

Config Command

Use the config command to view and modify settings

Configuration Files

Create custom configuration files for different projects

Environment Variables

The most common way to configure Transfer Learning is through environment variables. These can be set in your shell or in a .env file in the project root directory.

Core Settings

string
required
Your OpenAI API key for accessing GPT-4 Vision models.
string
Your Anthropic API key for Claude models (optional).
string
Your Hugging Face API key for accessing models (optional).

Processing Settings

integer
default:"30"
Interval between frame extractions (in frames).
integer
default:"100"
Maximum number of frames to extract per video.
integer
default:"30"
Number of frames to process in each batch.
integer
default:"100"
Maximum number of concurrent batches to process.
string
default:".mp4,.avi,.mov,.mkv"
Comma-separated list of supported video formats.
integer
default:"500"
Maximum video size in megabytes.

Model Settings

string
default:"gpt-4o-mini"
OpenAI model to use for guide generation.
string
default:"o3-mini"
Vision model to use for image analysis.
string
default:"gpt-4o-mini"
Faster model to use for simpler tasks.
string
default:"base"
Whisper model to use for transcription (tiny, base, small, medium, large).
string
default:"cpu"
Device to use for Whisper transcription (cpu, cuda).
string
default:"int8"
Compute type for Whisper models (float16, int8).

Cache Settings

boolean
default:"true"
Enable or disable caching.
integer
default:"24"
Time-to-live for cache entries in hours.

Monitoring Settings

boolean
default:"true"
Enable or disable monitoring and metrics collection.
string
default:"INFO"
Logging level (DEBUG, INFO, WARNING, ERROR).
boolean
default:"true"
Enable or disable metrics collection.

Using the Config Command

The config command allows you to view and modify configuration settings:

Creating a Custom Configuration File

You can create a custom .env file for different projects:

Directory Configuration

Transfer Learning uses several directories for storing data, logs, and metrics. You can customize these directories:
string
default:"./data"
Base directory for all data storage.
string
default:"./.cache"
Directory for cache storage.
string
default:"./logs"
Directory for log files.
string
default:"./data/videos"
Directory for downloaded videos.
string
default:"./data/frames"
Directory for extracted frames.
string
default:"./data/transcripts"
Directory for transcripts.
string
default:"./data/guides"
Directory for generated guides.
string
default:"./data/analysis"
Directory for analysis results.
string
default:"./data/temp"
Directory for temporary files.

Configuration Examples

For high-quality processing with detailed guides:
For faster processing with lower resource usage:
For GPU-accelerated processing:
For detailed logging and debugging:

Command-Line Options

Most configuration options can also be passed directly to CLI commands:

Configuration Precedence

Configuration options are applied in the following order of precedence (highest to lowest):
  1. Command-line options
  2. Environment variables
  3. .env file
  4. Default values
This means that command-line options will override environment variables, which will override values in the .env file, which will override default values.

Validating Configuration

You can validate your configuration using the config command:
This will check that all required configuration options are set and that values are within acceptable ranges.

Troubleshooting

If you encounter errors about a missing API key:
  1. Check that your API key is correctly set in the .env file
  2. Verify that the .env file is in the correct location
  3. Try setting the API key as an environment variable:
If you encounter errors about directory permissions:
  1. Check that the user running Transfer Learning has write permissions to the data directories
  2. Try setting custom directory paths in locations where you have write permissions:
If you encounter memory issues during processing:
  1. Reduce the batch size with --batch-size
  2. Reduce the maximum concurrent batches with --max-concurrent
  3. Increase the frame extraction interval to process fewer frames