ci: enable offline mode when local cache is complete to avoid HF Hub … (#16121)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user