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 fileCLI Options
Pass options directly to CLI commands
Config Command
Use the
config command to view and modify settingsConfiguration 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
Theconfig 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
High-Quality Processing
High-Quality Processing
For high-quality processing with detailed guides:
Fast Processing
Fast Processing
For faster processing with lower resource usage:
GPU Acceleration
GPU Acceleration
For GPU-accelerated processing:
Detailed Logging
Detailed Logging
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):- Command-line options
- Environment variables
.envfile- Default values
.env file, which will override default values.
Validating Configuration
You can validate your configuration using theconfig command:
Troubleshooting
Missing API Key
Missing API Key
If you encounter errors about a missing API key:
- Check that your API key is correctly set in the
.envfile - Verify that the
.envfile is in the correct location - Try setting the API key as an environment variable:
Directory Permissions
Directory Permissions
If you encounter errors about directory permissions:
- Check that the user running Transfer Learning has write permissions to the data directories
- Try setting custom directory paths in locations where you have write permissions:
Memory Issues
Memory Issues
If you encounter memory issues during processing:
- Reduce the batch size with
--batch-size - Reduce the maximum concurrent batches with
--max-concurrent - Increase the frame extraction interval to process fewer frames