Skip to content

Move examples from cog-examples to cog#3055

Draft
anish-sahoo wants to merge 4 commits into
mainfrom
update-examples
Draft

Move examples from cog-examples to cog#3055
anish-sahoo wants to merge 4 commits into
mainfrom
update-examples

Conversation

@anish-sahoo

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread examples/z-image-turbo/run.py Fixed
Comment thread examples/hello-concurrency/run.py Fixed

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

This PR moves example models from the external cog-examples repo into the main cog repo and updates the test harness to support base_dir for local models. Good cleanup overall.

I found two actionable issues:

  1. HIGH: The managed-weights weights.lock was regenerated from incomplete/stub weights. The parakeet model.safetensors is listed as 135 bytes instead of ~2.5GB.
  2. MEDIUM: The hello-train model lost its train_tests entry in the manifest, removing training test coverage even though the example still supports training.

Comment thread examples/managed-weights/weights.lock Outdated
Comment thread tools/test-harness/manifest.yaml
@ask-bonk

ask-bonk Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. HIGHexamples/managed-weights/weights.lock was regenerated from incomplete/stub weights. The parakeet model.safetensors is listed as 135 bytes instead of ~2.5GB, and the total size dropped from ~2.5GB to ~1.1MB. Please regenerate from the actual weights or revert this file.

  2. MEDIUMhello-train lost its train_tests entry in tools/test-harness/manifest.yaml even though the example still contains train.py and a train: field in cog.yaml. This removes training test coverage. I've posted a suggestion to restore it.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. HIGHexamples/managed-weights/weights.lock was regenerated from incomplete/stub weights. The parakeet model.safetensors is listed as 135 bytes instead of ~2.5GB, and the total size dropped from ~2.5GB to ~1.1MB. Please regenerate from the actual weights or revert this file.

  2. MEDIUMhello-train lost its train_tests entry in tools/test-harness/manifest.yaml even though the example still contains train.py and a train: field in cog.yaml. This removes training test coverage. I've posted a suggestion to restore it.

  3. MEDIUMexamples/z-image-turbo/run.py uses tempfile.mktemp() which creates a predictable temporary file path (flagged by CodeQL). Replace with tempfile.NamedTemporaryFile(delete=False) for safety.

  4. MEDIUMexamples/hello-concurrency/run.py has an empty except FileNotFoundError: pass block. Add a logging statement to document the intent.

Comment thread examples/managed-weights/weights.lock
Comment thread tools/test-harness/manifest.yaml
Comment thread examples/z-image-turbo/run.py Outdated
Comment thread examples/hello-concurrency/run.py
@ask-bonk

ask-bonk Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. HIGHexamples/managed-weights/weights.lock was regenerated from incomplete/stub weights. The parakeet model.safetensors is listed as 135 bytes instead of ~2.5GB, and the total size dropped from ~2.5GB to ~1.1MB. Please regenerate from the actual weights or revert this file.

  2. MEDIUMhello-train lost its train_tests entry in tools/test-harness/manifest.yaml even though the example still contains train.py and a train: field in cog.yaml. This removes training test coverage. I've posted a suggestion to restore it.

  3. MEDIUMexamples/z-image-turbo/run.py uses tempfile.mktemp() which creates a predictable temporary file path (flagged by CodeQL). Replace with tempfile.NamedTemporaryFile(delete=False) for safety.

  4. MEDIUMexamples/hello-concurrency/run.py has an empty except FileNotFoundError: pass block. Add a logging statement to document the intent.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. MEDIUMexamples/blur/run.py returns the built-in input function instead of the image parameter when blur == 0. This is a logic bug.
  2. MEDIUMhello-train is still missing its train_tests entry in tools/test-harness/manifest.yaml even though the example contains train.py and a train: field in cog.yaml. This removes training test coverage.

Comment thread examples/blur/run.py Outdated
Comment thread tools/test-harness/manifest.yaml
@ask-bonk

ask-bonk Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. MEDIUMexamples/blur/run.py returns the built-in input function instead of the image parameter when blur == 0. This is a logic bug.
  2. MEDIUMhello-train is still missing its train_tests entry in tools/test-harness/manifest.yaml even though the example contains train.py and a train: field in cog.yaml. This removes training test coverage.

Both issues have suggestions posted as review comments.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. MEDIUMhello-train is still missing its train_tests entry in tools/test-harness/manifest.yaml even though the example contains train.py and a train: field in cog.yaml. The test harness still fully supports train_tests (see manifest.go and runner.go), and there is no visible replacement mechanism or deprecation marker in the codebase. Removing the only training test without a documented alternative creates a coverage gap.

repo: local
base_dir: ../../examples
path: hello-train
gpu: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello-train still supports training (train.py + train: in cog.yaml) but the train_tests coverage was removed. The test harness still processes train_tests, and there is no deprecation comment or replacement mechanism visible in the code. Please either restore the test or, if train_tests is truly deprecated, add a deprecation marker to the manifest schema and runner.

Suggested change
gpu: false
gpu: false
train_tests:
- description: "train produces weights file"
inputs:
prefix: "custom"
expect:
type: not_empty
tests:

@ask-bonk

ask-bonk Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Summary: Moves example models from cog-examples into the main repo and updates the test harness to support base_dir for local models.

Issues found:

  1. MEDIUMhello-train is still missing its train_tests entry in tools/test-harness/manifest.yaml even though the example contains train.py and a train: field in cog.yaml. The test harness still fully supports train_tests (see manifest.go and runner.go), and there is no visible replacement mechanism or deprecation marker in the codebase. Removing the only training test without a documented alternative creates a coverage gap.

Posted as review comment on PR #3055.

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants