No project description provided
Project description
AutoCog
Generate predict.py and cog.yaml automatically using GPT4
Install
pip install autocog
Usage
First, specify your AI provider with --ai-provider
and set your OpenAI/Anthropic API key in an environment variable
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-...
In the repo you want to cog-ify, run
autocog
This will generate a cog.yaml and predict.py based on the files in the current directory. It will then run the model and if it fails to run, it will attempt to fix the error and run it again. By default it has 5 attempts to fix it, which can be changed with the --attempts
flag.
If your model needs a GPU to run, you need to run AutoCog on a GPU machine.
Human in the loop
Sometimes AutoCog fails to create a working Cog configuration. In those cases you, the human, have to step in and edit the cog.yaml and predict.py files.
Once you have edited them, let AutoCog continue by running autocog
again. If you'd like to recreate predict.py
and cog.yaml
from scratch, run autocog --initialize
.
By default, AutoCog will guess a cog predict
command to run the model. If you want to specify your own predict command, use the --predict-command
flag.
If you want AutoCog to take the generation of cog.yaml
and predict.py
in a specific direction, you can use the --tell
flag to prompt GPT4:
autocog --tell="Add inputs to allow for inpainting"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file autocog-0.0.9.tar.gz
.
File metadata
- Download URL: autocog-0.0.9.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ddf26c261255848c561539e1907ac158875d7988551a035d7883e5bd8ede7a |
|
MD5 | c49f280e994a068a738db50f2719e59f |
|
BLAKE2b-256 | 57a771f87f270bec3849328edc520ce35305312e2c55e27bcf37a2c439c74774 |
File details
Details for the file autocog-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: autocog-0.0.9-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4881fc6422b555d711747b64c346fadb5ac4a7bda6fe9c5832d44ce2ce9d45b |
|
MD5 | b7d1c393c8c069bfbd5c1589313a9ce0 |
|
BLAKE2b-256 | fa3ff56003e1c097b573e75ebc3d0001335da4036225485524263e6895a383e9 |