Skip to content

Commit 6ec6a23

Browse files
committed
fix typo; useless code
Signed-off-by: HonestDeng <2958906959@qq.com>
1 parent 8317857 commit 6ec6a23

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

examples/offline_inference/mammothmodal2_preview/run_mammothmoda2_image_summarize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Offline inference example: MammothModa2 image summarization (single AR stage).
33
44
Example:
5-
uv run python examples/offline_inference/mammothmodal2_preview/run_mammothmoda2_image_summary.py \
5+
uv run python examples/offline_inference/mammothmodal2_preview/run_mammothmoda2_image_summarize.py \
66
--model /data/datasets/models-hf/MammothModa2-Preview \
77
--image /path/to/input.jpg \
88
--question "Please summarize the content of this image."

tests/e2e/offline_inference/test_mammoth_moda2.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,23 @@ def test_missing_llm_config_raises(self):
110110
_ = Mammothmoda2Config(llm_config=None).image_token_id
111111

112112
def test_t2i_generation_config_json(self):
113-
"""t2i_generation_config.json must contain required token-ID fields."""
113+
"""t2i_generation_config.json must contain required token-ID and sampling fields."""
114114
cfg = _load_t2i_gen_config(MODEL_PATH)
115-
for key in ("eol_token_id", "visual_token_start_id", "visual_token_end_id"):
115+
for key in ("eol_token_id", "visual_token_start_id", "visual_token_end_id", "top_k"):
116116
assert key in cfg and isinstance(cfg[key], int)
117117

118+
def test_model_config_visual_ids(self):
119+
"""config.json llm_config must contain the four Qwen2.5-VL vision token IDs."""
120+
cfg_path = Path(MODEL_PATH) / "config.json"
121+
if not cfg_path.exists():
122+
pytest.skip(f"config.json not found at {cfg_path}")
123+
with cfg_path.open() as f:
124+
llm_cfg = json.load(f).get("llm_config", {})
125+
for key in ("image_token_id", "video_token_id", "vision_start_token_id", "vision_end_token_id"):
126+
assert key in llm_cfg and isinstance(llm_cfg[key], int), (
127+
f"Missing or non-int field '{key}' in config.json llm_config"
128+
)
129+
118130

119131
# ---------------------------------------------------------------------------
120132
# 2. Stage input processor: ar2dit helpers + tests (CPU-only)

vllm_omni/model_executor/stage_input_processors/mammoth_moda2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def ar2dit(
6161

6262
gen_token_mask = full_token_ids_t >= gen_vocab_start_index
6363

64-
visual_token_mask = torch.zeros_like(gen_token_mask)
6564
visual_token_mask = torch.isin(
6665
full_token_ids_t,
6766
torch.tensor(visual_ids, dtype=torch.long, device=mask_device),

0 commit comments

Comments
 (0)