[Misc] allow specify is_mm_prefix_lm in hf_config (#34215)

This commit is contained in:
Phúc H. Lê Khắc
2026-02-10 18:16:21 +07:00
committed by GitHub
parent e042d7e685
commit 94de871546

View File

@@ -1119,6 +1119,9 @@ class ModelConfig:
@cached_property
def is_mm_prefix_lm(self) -> bool:
"""Whether to use bidirectional attention for mm positions."""
if hasattr(self.hf_config, "is_mm_prefix_lm"):
return bool(self.hf_config.is_mm_prefix_lm)
# fallback to list of known models
MM_PREFIX_LM_MODELS = (
"gemma3",
"molmo2",