load_file_from_url() downloads the model from HF_ENDPOINT if it is set

This commit is contained in:
licyk 2025-03-22 16:00:06 +08:00
parent 374bb6cc38
commit 8a09e9f209
6 changed files with 11 additions and 10 deletions

View file

@ -76,7 +76,7 @@ class DisableInitialization(ReplaceHelper):
def transformers_utils_hub_get_file_from_cache(original, url, *args, **kwargs):
# this file is always 404, prevent making request
if url == f'{shared.hf_endpoint}/openai/clip-vit-large-patch14/resolve/main/added_tokens.json' or url == 'openai/clip-vit-large-patch14' and args[0] == 'added_tokens.json':
if url == 'https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/added_tokens.json' or url == 'openai/clip-vit-large-patch14' and args[0] == 'added_tokens.json':
return None
try: