[BugFix] HFValidationError with cloud storage URIs when HF_HUB_OFFLINE=1 (#39155)

Signed-off-by: Injae Ryou <injaeryou@gmail.com>
This commit is contained in:
Injae Ryou
2026-05-27 10:53:32 -05:00
committed by GitHub
parent 03d9cc2fe2
commit 165460941f
4 changed files with 63 additions and 10 deletions
+14 -9
View File
@@ -747,15 +747,20 @@ class EngineArgs:
load_general_plugins()
# when use hf offline,replace model and tokenizer id to local model path
if huggingface_hub.constants.HF_HUB_OFFLINE:
model_id = self.model
self.model = get_model_path(self.model, self.revision)
if model_id is not self.model:
logger.info(
"HF_HUB_OFFLINE is True, replace model_id [%s] to model_path [%s]",
model_id,
self.model,
)
if self.tokenizer is not None:
# Skip cloud storage URIs (s3://, gs://, az://) — they are not
# HF repo IDs and will be resolved later by
# ModelConfig.maybe_pull_model_tokenizer_for_runai().
if not is_cloud_storage(self.model):
model_id = self.model
self.model = get_model_path(self.model, self.revision)
if model_id is not self.model:
logger.info(
"HF_HUB_OFFLINE is True, replace model_id "
"[%s] to model_path [%s]",
model_id,
self.model,
)
if self.tokenizer is not None and not is_cloud_storage(self.tokenizer):
tokenizer_id = self.tokenizer
self.tokenizer = get_model_path(self.tokenizer, self.tokenizer_revision)
if tokenizer_id is not self.tokenizer: