diff --git a/intel_extension_for_transformers/transformers/modeling/modeling_auto.py b/intel_extension_for_transformers/transformers/modeling/modeling_auto.py index 4e5c86ec7ad..ba965d7a45f 100644 --- a/intel_extension_for_transformers/transformers/modeling/modeling_auto.py +++ b/intel_extension_for_transformers/transformers/modeling/modeling_auto.py @@ -1453,7 +1453,7 @@ def train_func(model): return model else: if model_hub=="modelscope": - from modelscope import AutoModelForCausalLM + from modelscope import AutoModelForCausalLM # pylint: disable=E0401 model = AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path,trust_remote_code=True) else: model = cls.ORIG_MODEL.from_pretrained( @@ -1714,7 +1714,7 @@ def load_low_bit(cls, pretrained_model_name_or_path, *model_args, **kwargs): "_commit_hash": commit_hash, } if model_hub=="modelscope": - from modelscope import snapshot_download + from modelscope import snapshot_download # pylint: disable=E0401 model_dir = snapshot_download(pretrained_model_name_or_path) if os.path.exists(model_dir+"/model.safetensors"): resolved_archive_file = model_dir+"/model.safetensors" @@ -1725,7 +1725,8 @@ def load_low_bit(cls, pretrained_model_name_or_path, *model_args, **kwargs): resolved_archive_file is not None ), "Don't detect this model checkpoint" else: - resolved_archive_file = cached_file(pretrained_model_name_or_path, filename, **cached_file_kwargs) + resolved_archive_file = cached_file(pretrained_model_name_or_path, filename, + **cached_file_kwargs) # Since we set _raise_exceptions_for_missing_entries=False, we don't get an exception but a None # result when internet is up, the repo and revision exist, but the file does not.