cog.yaml and predict.py in the current directory. These files provide a starting template for defining your model’s environment and prediction interface.
Usage
What It Creates
When you runcog init, Cog creates two files in the current directory:
cog.yaml
A configuration file that defines your model’s environment:cog.yaml
predict.py
A template prediction interface:predict.py
Examples
Initialize a new project
Start from scratch
cog init will not overwrite existing cog.yaml or predict.py files. If these files already exist, the command will exit without making changes.Next Steps
After runningcog init, you’ll want to:
- Edit
cog.yamlto specify your Python version, system packages, and dependencies - Edit
predict.pyto implement your model’s prediction logic - Test your model with
cog predict
cog.yaml reference
Learn about all configuration options
Python API
Define your prediction interface
cog predict
Test your model locally
Your own model guide
Complete setup guide
Options
| Flag | Description |
|---|---|
-h, --help | Show help for the init command |
Related Commands
- cog build - Build a Docker image after initialization
- cog predict - Test your model
- cog run - Run commands in your environment