Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pkg/cli/init-templates/cog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ build:
# python version in the form '3.11' or '3.11.4'
python_version: "3.11"

# a list of packages in the format <package-name>==<version>
# python_packages:
# - "numpy==1.19.4"
# - "torch==1.8.0"
# - "torchvision==0.9.0"
# path to a Python requirements.txt file
python_requirements: requirements.txt

# commands run after the environment is setup
# run:
Expand Down
23 changes: 23 additions & 0 deletions pkg/cli/init-templates/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This is a normal Python requirements.txt file.

# You can add dependencies directly from PyPI:
#
# numpy==1.26.4
# torch==2.2.1
# torchvision==0.17.1


# You can also add Git repos as dependencies, but you'll need to add git to the system_packages list in cog.yaml:
#
# build:
# system_packages:
# - "git"
#
# Then you can use a URL like this:
#
# git+https://github.com/huggingface/transformers


# You can also pin Git repos to a specific commit:
#
# git+https://github.com/huggingface/transformers@2d1602a
4 changes: 4 additions & 0 deletions pkg/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var predictPyContent []byte
//go:embed init-templates/.github/workflows/push.yaml
var actionsWorkflowContent []byte

//go:embed init-templates/requirements.txt
var requirementsTxtContent []byte

func newInitCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "init",
Expand Down Expand Up @@ -52,6 +55,7 @@ func initCommand(args []string) error {
"predict.py": predictPyContent,
".dockerignore": dockerignoreContent,
".github/workflows/push.yaml": actionsWorkflowContent,
"requirements.txt": requirementsTxtContent,
}

for filename, content := range fileContentMap {
Expand Down
Loading