Preserve revision pins in secondary artifact loaders (#51446)

Signed-off-by: Clinton Thomas <1033162+KernelClint@users.noreply.github.com>
Co-authored-by: Lucas Bourtoule <35483370+dhalf@users.noreply.github.com>
This commit is contained in:
Clinton Thomas
2026-08-11 04:33:10 +00:00
committed by GitHub
co-authored by Lucas Bourtoule
parent adc1200597
commit 90fd4a333f
11 changed files with 226 additions and 13 deletions
+7 -1
View File
@@ -890,7 +890,11 @@ class ModelConfig:
convertor_cls = MODEL_ARCH_CONFIG_CONVERTORS.get(
self.hf_config.model_type, ModelArchConfigConvertorBase
)
convertor = convertor_cls(self.hf_config, self.hf_text_config)
convertor = convertor_cls(
self.hf_config,
self.hf_text_config,
revision=getattr(self, "revision", None),
)
return convertor.convert(
supports_multimodal=self._supports_multimodal_for_mm_prefix()
)
@@ -1651,6 +1655,7 @@ class ModelConfig:
self.hf_config_path or self.model,
trust_remote_code=self.trust_remote_code,
revision=self.revision,
code_revision=self.code_revision,
config_format=self.config_format,
hf_token=self.hf_token,
)
@@ -1658,6 +1663,7 @@ class ModelConfig:
config = try_get_generation_config(
self.generation_config,
trust_remote_code=self.trust_remote_code,
code_revision=self.code_revision,
config_format=self.config_format,
hf_token=self.hf_token,
)