Skip to content

Latest commit

 

History

History
109 lines (84 loc) · 3.32 KB

File metadata and controls

109 lines (84 loc) · 3.32 KB

Code Structure

Cosmos-H-Surgical is a focused package layered on a pinned public Cosmos Framework revision. The full framework source is not copied into this repository.

Repository Layout

Cosmos-H-Surgical/
|-- cosmos_h_surgical/
|   |-- cli.py
|   |-- checkpoints.py
|   |-- inference.py
|   |-- training.py
|   |-- data/                  # Surgical manifests and Predict/Transfer datasets
|   |-- provenance.py
|   |-- release.py
|   `-- configs/
|-- datasets/                 # Synthetic toy post-training dataset
|-- docs/
|-- examples/
|   |-- post_training/
|-- inputs/                   # Predict, Transfer, and prompt examples
|-- tests/
|-- pyproject.toml
|-- uv.lock
|-- UPSTREAM.md
`-- release-manifest.json

The historical Cosmos 2.5 implementation remains available on the cosmos-2.5 branch and signed v0.2.0 tag. The former top-level predict/ and transfer/ source trees are not part of the Cosmos 3 branch.

Runtime Flow

cosmos-h-surgical infer
        |
        v
cosmos_h_surgical.cli
        |
        v
cosmos_h_surgical.inference
        |
        +-- normalize supported surgical input compatibility
        +-- prepare a temporary checkpoint config view when needed
        +-- configure distributed timeout
        |
        v
pinned cosmos_framework.scripts.inference

The installed framework files are never overwritten. Compatibility behavior is process-local and scoped to the inference command.

Package Responsibilities

cli.py

Provides the stable cosmos-h-surgical command and routes inference, training, training-data preparation and validation, framework-provenance, and release-validation subcommands.

inference.py

Delegates to the public framework CLI. It also supports the validated surgical resize_mode contract, earlier Cosmos 3 checkpoint configuration, and the distributed timeout needed by the release test configuration.

checkpoints.py

Loads model metadata from release-manifest.json and registers the public Cosmos-H-Surgical model key at the pinned v0.3.0 revision.

training.py, configs/, and data/

Register project-owned surgical experiment configuration before invoking the framework trainer. The data package preserves the surgical manifest, adjacent caption, and transfer-control sidecar contract without embedding storage paths.

provenance.py and UPSTREAM.md

Record the immutable public framework repository, revision, and release status. Framework changes require lockfile regeneration and compatibility testing.

release.py

Validates release metadata and rejects known internal path and URL markers.

Ownership Boundary

This repository owns:

  • Surgical model metadata and aliases
  • Surgical input examples and documentation
  • Surgical training configuration
  • Surgical dataset loading and portable manifest validation
  • Narrow compatibility adapters required by approved checkpoints
  • Release-manifest validation

The pinned Cosmos Framework owns model implementation, distributed inference, generic input parsing, transfer operators, training infrastructure, and prompt upsampling.

See UPSTREAM.md for the revision and update policy, and the pinned upstream code-structure guide for framework internals.