[CI] Avoid unnecessary Hugging Face metadata requests (#49508)
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user