[Transformers v5] Vendor HCXVisionConfig for compatibility (#38447)

Signed-off-by: Fang Han <fhan0520@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fang Han
2026-05-04 04:19:52 +00:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 67058ca326
commit c103c02a1a
4 changed files with 79 additions and 9 deletions
+4 -2
View File
@@ -101,6 +101,7 @@ _CONFIG_REGISTRY: dict[str, type[PretrainedConfig]] = LazyConfigDict(
fireredlid="FireRedLIDConfig",
funaudiochat="FunAudioChatConfig",
granite4_vision="Granite4VisionConfig",
hyperclovax_vlm="HCXVisionConfig",
hunyuan_vl="HunYuanVLConfig",
hy_v3="HYV3Config",
isaac="IsaacConfig",
@@ -217,8 +218,9 @@ class HFConfigParser(ConfigParserBase):
)
else:
if model_type in _CONFIG_REGISTRY:
# Register the config class to AutoConfig to ensure it's used in future
# calls to `from_pretrained`
# Register the config class to AutoConfig to ensure it's used
# in future calls to `from_pretrained` (e.g. from
# AutoTokenizer or AutoProcessor).
config_class = _CONFIG_REGISTRY[model_type]
config_class.model_type = model_type
AutoConfig.register(model_type, config_class, exist_ok=True)