cog
cog copied to clipboard
Cog Push Error: This image doesn't look like it was built with Cog.
When using cog to push to repilcate we are getting the following error: This image doesn't look like it was built with Cog. You can only push images built with Cog to Replicate: https://github.com/replicate/cog
Here is the github actions that we are using:
name: cog-build-deploy
on:
workflow_call:
inputs:
folder:
required: true
type: string
description: "Path to the model folder"
model_name:
required: true
type: string
description: "Name of the model to deploy"
gpu:
required: false
type: boolean
description: "Set to true if your model requires a GPU"
default: false
secrets:
REPLICATE_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out code
uses: actions/checkout@v4
- name: Setup Cog
uses: replicate/[email protected]
with:
token: ${{ secrets.REPLICATE_TOKEN }}
install-cuda: ${{ inputs.gpu }}
cog-version: v0.9.7
- name: Download weights
working-directory: ${{ inputs.folder }}
run: |
echo ${{ secrets.REPLICATE_TOKEN }} | cog login --token-stdin
chmod +x script/download_weights
cog run script/download_weights
- name: Push to Replicate
working-directory: ${{ inputs.folder }}
env:
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_TOKEN }}
run: |
echo ${{ secrets.REPLICATE_TOKEN }} | cog login --token-stdin
cog push r8.im/my-org/${{ inputs.model_name }}
Hey @kiradeva. That error comes from Replicate's registry proxy and it appears to occur when something is wrong with the Cog version number or the cog.yaml config.
Please try the following changes and let us know if it fixes your workflow:
- Use
replicate/setup-cog@v2 - Remove the buildx step from your workflow, as it's covered by setup-cog
- Make sure the
working-directory: ${{ inputs.folder }}is referring to the correct location