Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix format error
Browse files Browse the repository at this point in the history
Signed-off-by: intellinjun <[email protected]>
  • Loading branch information
intellinjun committed Jul 9, 2024
1 parent b4e7159 commit 6c26dd2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"
Expand All @@ -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.
Expand Down

0 comments on commit 6c26dd2

Please sign in to comment.