From a90509d82ed3ac12e2f0ae8ef0a60e06b3d001c6 Mon Sep 17 00:00:00 2001 From: zaypen Date: Fri, 12 Apr 2024 05:28:10 +0800 Subject: [PATCH] Model downloader: Take HF_ENDPOINT in consideration (#5571) --- download-model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/download-model.py b/download-model.py index f4e1f607..eca17c43 100644 --- a/download-model.py +++ b/download-model.py @@ -21,7 +21,7 @@ import tqdm from requests.adapters import HTTPAdapter from tqdm.contrib.concurrent import thread_map -base = "https://huggingface.co" +base = os.environ.get("HF_ENDPOINT") or "https://huggingface.co" class ModelDownloader: @@ -112,12 +112,12 @@ class ModelDownloader: sha256.append([fname, dict[i]['lfs']['oid']]) if is_text: - links.append(f"https://huggingface.co/{model}/resolve/{branch}/{fname}") + links.append(f"{base}/{model}/resolve/{branch}/{fname}") classifications.append('text') continue if not text_only: - links.append(f"https://huggingface.co/{model}/resolve/{branch}/{fname}") + links.append(f"{base}/{model}/resolve/{branch}/{fname}") if is_safetensors: has_safetensors = True classifications.append('safetensors')