little change

This commit is contained in:
songkey-win
2025-06-26 14:54:27 +08:00
parent 19cd5d725e
commit f659a25cfc
2 changed files with 19 additions and 10 deletions
+18 -9
View File
@@ -132,12 +132,16 @@ def download_file_from_cloud(model_id,
print(e)
assert False, "@@ Failed to download model from modelscope"
else:
from huggingface_hub import hf_hub_download
from huggingface_hub import hf_hub_download, login
try:
model_path = hf_hub_download(model_id, filename=file_name, cache_dir=cache_dir, token=hf_token)
except Exception as e:
print(e)
assert False, "@@ Failed to download model from huggingface hub"
model_path = hf_hub_download(model_id, filename=file_name, cache_dir=cache_dir)
except:
try:
login(token=hf_token)
model_path = hf_hub_download(model_id, filename=file_name, cache_dir=cache_dir)
except Exception as e:
print(e)
assert False, "@@ Failed to download model from huggingface hub"
return model_path
def creat_model_from_cloud(model_cls,
@@ -161,8 +165,13 @@ def creat_model_from_cloud(model_cls,
model = model_cls.from_pretrained(model_path, subfolder=subfolder)
else:
try:
model = model_cls.from_pretrained(model_id, subfolder=subfolder, cache_dir=cache_dir, token=hf_token)
except Exception as e:
print(e)
assert False, "@@ Failed to download model from huggingface hub"
model = model_cls.from_pretrained(model_id, subfolder=subfolder, cache_dir=cache_dir)
except:
try:
from huggingface_hub import login
login(token=hf_token)
model = model_cls.from_pretrained(model_id, subfolder=subfolder, cache_dir=cache_dir)
except Exception as e:
print(e)
assert False, "@@ Failed to download model from huggingface hub"
return model
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui_hellomeme"
description = "This repository is the official implementation of the [a/HelloMeme](https://arxiv.org/pdf/2410.22901) ComfyUI interface"
version = "1.3.20"
version = "1.3.21"
license = {file = "LICENSE"}
[project.urls]