Skip to main content

No project description provided

Project description

AutoCog

PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autocog-0.0.6.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

autocog-0.0.6-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file autocog-0.0.6.tar.gz.

File metadata

  • Download URL: autocog-0.0.6.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for autocog-0.0.6.tar.gz
Algorithm Hash digest
SHA256 adcda43874f6e330c7cc41f853c2f30a02d0e277ac46c6df76e6f5c4212ddaac
MD5 b16e6b4783452f6955060021ca97e860
BLAKE2b-256 2551cb2cfc4bb1bdf73558e43388a51e2fea6837d3b10c6ba6c39d5097b2dab9

See more details on using hashes here.

File details

Details for the file autocog-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: autocog-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for autocog-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7ca4778b7b92046ab46daef74beeb8e6e262d58188c5be120bdfee7153efdfa5
MD5 c6d56bde16c096866c60e0acaa2b9404
BLAKE2b-256 43e57ba9f3beb6e46be350048d1135a41401cb792a087c76646ab91fb5da336a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page