This commit is contained in:
songkey-win
2025-06-27 17:46:54 +08:00
parent 6e19fc3df6
commit 6ccb7d2c8e
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -144,8 +144,9 @@ def creat_model_from_cloud(model_cls,
cache_dir=None,
subfolder=None,
hf_token=None):
if osp.isfile(model_id) and model_id.endswith('.safetensors'):
if osp.isdir(model_id):
model = model_cls.from_pretrained(model_id)
elif osp.isfile(model_id) and model_id.endswith('.safetensors'):
model = model_cls.from_single_file(model_id)
else:
if modelscope: