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
Your OpenAI API key for accessing GPT-4 Vision models.
Your Anthropic API key for Claude models (optional).
Your Hugging Face API key for accessing models (optional).
Processing Settings
Interval between frame extractions (in frames).
Maximum number of frames to extract per video.
Number of frames to process in each batch.
Maximum number of concurrent batches to process.
Comma-separated list of supported video formats.
Maximum video size in megabytes.
Model Settings
OpenAI model to use for guide generation.
Vision model to use for image analysis.
Faster model to use for simpler tasks.
Whisper model to use for transcription (tiny, base, small, medium, large).
Device to use for Whisper transcription (cpu, cuda).
Compute type for Whisper models (float16, int8).
Cache Settings
Enable or disable caching.
Time-to-live for cache entries in hours.
Monitoring Settings
Enable or disable monitoring and metrics collection.
Logging level (DEBUG, INFO, WARNING, ERROR).
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:Base directory for all data storage.
Directory for cache storage.
Directory for log files.
Directory for downloaded videos.
Directory for extracted frames.
Directory for transcripts.
Directory for generated guides.
Directory for analysis results.
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