[Misc] allow specify is_mm_prefix_lm in hf_config (#34215)
This commit is contained in:
@@ -1119,6 +1119,9 @@ class ModelConfig:
|
|||||||
@cached_property
|
@cached_property
|
||||||
def is_mm_prefix_lm(self) -> bool:
|
def is_mm_prefix_lm(self) -> bool:
|
||||||
"""Whether to use bidirectional attention for mm positions."""
|
"""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 = (
|
MM_PREFIX_LM_MODELS = (
|
||||||
"gemma3",
|
"gemma3",
|
||||||
"molmo2",
|
"molmo2",
|
||||||
|
|||||||
Reference in New Issue
Block a user