[CI] Avoid unnecessary Hugging Face metadata requests (#49508)

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
This commit is contained in:
Andreas Karatzas
2026-07-24 12:33:53 -07:00
committed by GitHub
parent 9863102ed9
commit 7e51939e25
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -579,9 +579,9 @@ class ModelConfig:
self.hf_text_config, "attention_chunk_size", None
)
self.encoder_config = self._get_encoder_config()
self.hf_image_processor_config = get_hf_image_processor_config(
self.model, hf_token=self.hf_token, revision=self.revision
)
# Image-processor metadata is only consumed by multimodal models.
# Probing it for text-only models causes avoidable Hub requests.
self.hf_image_processor_config: dict[str, Any] = {}
architectures = self.architectures
registry = self.registry
@@ -703,6 +703,9 @@ class ModelConfig:
# Init multimodal config if needed
if self._model_info.supports_multimodal:
self.hf_image_processor_config = get_hf_image_processor_config(
self.model, hf_token=self.hf_token, revision=self.revision
)
if (
mm_encoder_tp_mode == "data"
and not self._model_info.supports_multimodal_encoder_tp_data
@@ -220,7 +220,7 @@ class DefaultModelLoader(BaseModelLoader):
# safetensors file. Using both breaks.
# Here, we download the `model.safetensors.index.json` and filter
# any files not found in the index.
if not is_local:
if not is_local and len(hf_weights_files) > 1:
download_safetensors_index_file_from_hf(
model_name_or_path,
index_file,