-
Prerequisites:
- Docker installed and running.
- Docker Compose installed.
- NVIDIA drivers and NVIDIA Container Toolkit (if you plan to use GPU and uncommented the GPU sections).
-
Navigate to your Project Root: Open a terminal and
cdinto the directory containing yourDockerfile,docker compose.yml, etc. -
Populate
.envfile: Make sure your.envfile has yourOPEN_ROUTER_API_KEY. -
Build the Docker Image:
docker build -t whitelightning:local . -
Run the Classifier Generation Agent: Use
docker runto execute your agent script with the desired arguments. -
General Syntax:
docker run --rm -v $(pwd):/app/models -e OPEN_ROUTER_API_KEY=YOUR_KEY_HERE whitelightning:local [Your arguments]API Key Options:
- Recommended: Pass the key as an environment variable using
-e OPEN_ROUTER_API_KEY=YOUR_KEY_HERE(overrides .env). - Alternative (dev/local): Use the .env file if you don't want to pass the key each time.
Examples:
- Generate a binary TensorFlow classifier for "sentiment analysis":
docker run --rm -v $(pwd)/models:/app/models -v $(pwd)/.env:/app/.env \ -e OPEN_ROUTER_API_KEY=YOUR_KEY_HERE \ whitelightning:local \ -p="Classify customer feedback as positive or negative sentiment" \ --model-type="tensorflow" \ --refinement-cycles=1 \ --generate-edge-cases="true" \ --lang="english"
- Generate a multiclass PyTorch classifier for "topic modeling":
docker run --rm -v $(pwd)/models:/app/models -v $(pwd)/.env:/app/.env \ -e OPEN_ROUTER_API_KEY=YOUR_KEY_HERE \ whitelightning:local \ -p "Categorize news articles into topics like sports, politics, or technology" \ --model-type="pytorch" \ # Add other relevant flags
- Recommended: Pass the key as an environment variable using
6Check Outputs:
After the command finishes, check your local models directory on your host machine. You should find the model artifacts, ONNX file, config JSON, etc.
This comprehensive setup should allow you to build and run your text classifier agent in a containerized and reproducible environment. Remember to adjust paths and configurations in settings.py regarding DEFAULT_OUTPUT_PATH if you want it to default to /app/models when running inside Docker.