Skip to content

Loading Cosmos3-Nano from a local snapshot path makes Reasoner text-only #158

Description

@haifujing

Bug Description

Loading the following Cosmos3-Nano snapshot through an absolute local path causes Reasoner image/video input to be treated as text-only:

nvidia/Cosmos3-Nano revision 411f42a

The snapshot contains vision_encoder/model.safetensors and multimodal processor files. However:

  1. Its config omits include_visual, which defaults to False.
  2. Its tokenizer configuration creates LLMTokenizerProcessor instead of Qwen3VLProcessor.

Using --checkpoint-path Cosmos3-Nano works because the registered YAML explicitly enables the visual tower and uses the multimodal processor.

Reproduction

Input JSON:

{
  "name": "video_reasoner",
  "model_mode": "reasoner",
  "prompt": "Describe what is happening in this video in one sentence.",
  "vision_path": "/absolute/path/to/video.mp4",
  "video_fps": 1.0,
  "max_new_tokens": 64,
  "do_sample": false
}

Command:

LD_LIBRARY_PATH= CUDA_VISIBLE_DEVICES=0 \
python -m cosmos_framework.scripts.inference \
  --parallelism-preset=latency \
  -i /tmp/reasoner-video.json \
  -o /tmp/cosmos3-output \
  --checkpoint-path /path/to/snapshots/411f42a8fdfb8c5b2583cb8786e0938f49796eaa \
  --seed=0 \
  --no-guardrails

Expected Behavior

The bundled vision tower and Qwen3VLProcessor should be loaded, allowing Reasoner image/video input.

Actual Behavior

The visual tower is initially disabled:

checkpoint's reasoner LM has no visual tower
(model config include_visual is false)

After manually enabling it, the text-only processor rejects video input:

LLMTokenizerProcessor does not implement apply_chat_template

Suggested Fix

When include_visual is omitted, infer it as True only if the checkpoint index references an existing vision_encoder shard. An explicit False should remain
authoritative.

When the checkpoint bundles the required processor and tokenizer files, load a local Qwen3VLProcessor instead of the legacy text-only processor.

System Information

  • Python 3.13.14
  • PyTorch 2.10.0+cu130
  • CUDA 13.0
  • NVIDIA RTX 5880 Ada Generation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions