Skip to content

Commit 2b812c0

Browse files
s-chundiclaude
andcommitted
[test] Fix SFT tokenization tests for VLM changes
- _build_trainer: set is_vlm/processor so _load_and_tokenize (which now reads them) works on the bare object.__new__ trainer. - vlm_processor fixture: importorskip torchvision so the VLM tests skip cleanly under the base dev extra instead of erroring (torchvision ships via the vllm-bearing extras used in CI). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e8abcde commit 2b812c0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/train/test_sft_tokenization.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def tokenizer():
3030

3131
@pytest.fixture(scope="module")
3232
def vlm_processor():
33+
# The Qwen3-VL processor pulls in a video processor that needs torchvision,
34+
# which only ships with the vllm-bearing extras (skyrl-train/fsdp), not the
35+
# base dev extra. Skip rather than error when it is unavailable.
36+
pytest.importorskip("torchvision")
3337
proc = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-2B-Instruct")
3438
if proc.tokenizer.pad_token is None:
3539
proc.tokenizer.pad_token = proc.tokenizer.eos_token
@@ -874,6 +878,8 @@ def _build_trainer(tokenizer, sft_cfg):
874878
trainer = object.__new__(SFTTrainer)
875879
trainer.sft_cfg = sft_cfg
876880
trainer.tokenizer = tokenizer
881+
trainer.is_vlm = False
882+
trainer.processor = None
877883
return trainer
878884

879885

0 commit comments

Comments
 (0)