Merge 16be10168c6bf1f72b4a566cf49cdd10dbbdcf1b into 254f6b986720c92ddf97fbb1a6a6465da8e87e29

This commit is contained in:
ゆり 2025-12-25 00:07:15 +00:00 committed by GitHub
commit 52672f57fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -588,6 +588,19 @@ class ModelConfig:
"repo name or path using the --tokenizer argument."
)
# Multimodal models require a tokenizer for processor initialization
# unless embedded inputs are enabled (enable_mm_embeds=True)
if self.skip_tokenizer_init and self.is_multimodal_model:
mm_config = getattr(self, "multimodal_config", None)
if mm_config is None or not mm_config.enable_mm_embeds:
raise ValueError(
"Multimodal models require a tokenizer for processing. "
"Please set skip_tokenizer_init=False when using multimodal "
f"models like {self.model}. Alternatively, enable embedded "
"inputs with enable_mm_embeds=True if your inputs are "
"pre-embedded."
)
if self.disable_sliding_window:
# Set after get_and_verify_max_len to ensure that max_model_len
# can be correctly capped to sliding window size