ci: enable offline mode when local cache is complete to avoid HF Hub … (#16121)

This commit is contained in:
Hudson Xing
2026-01-16 12:15:33 +08:00
committed by GitHub
parent 6ee970a365
commit 21ee597e4a
6 changed files with 1959 additions and 112 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -566,7 +566,9 @@ class DefaultModelLoader(BaseModelLoader):
)
hf_config = AutoConfig.from_pretrained(
model_config.model_path, trust_remote_code=True
model_config.model_path,
trust_remote_code=True,
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
)
with init_empty_weights():
torch_dtype = getattr(hf_config, "torch_dtype", torch.float16)
@@ -599,6 +601,7 @@ class DefaultModelLoader(BaseModelLoader):
device_map=device_map,
**model_kwargs,
trust_remote_code=True,
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
)
# Handle both legacy modelopt_quant and unified quantization flags
if hasattr(model_config, "modelopt_quant") and model_config.modelopt_quant: