Skip to content

weights

state: released
maintainers: @YorickvP

Introduction

This module facilitates getting weights (mainly from huggingface) into your cog image. It can do this in two different ways: 1. Embedding into the image. This is suitable for small weights. 2. Loaded from replicate.delivery using pget. Your script should call the download-weights binary to do this during setup.

To use this, add a section to your cog.yaml:

weights:
  - src: thenlper/gte-large
    download_include: ["model.safetensors"]

Then, run cognix lock to write the weight information into the lock.json file. Call cognix push to push the weights to replicate.delivery.

Options

cog

cog.weights

type list of (submodule)
source cognix/modules/weights/interface.nix
default
[ ]
*
cog.weights.*.build_include

List of file globs to download at image build time

type list of string
source cognix/modules/weights/interface.nix
default
[ ]
example
[
  "model.safetensors"
]
cog.weights.*.download_include

List of file globs to download at image run time

type list of string
source cognix/modules/weights/interface.nix
default
[ ]
cog.weights.*.ref

branch name to fetch

type null or string
source cognix/modules/weights/interface.nix
default
null
cog.weights.*.rev

git revision to use

type null or string
source cognix/modules/weights/interface.nix
default
null
cog.weights.*.src
type string
source cognix/modules/weights/interface.nix
example
"thenlper/gte-small"