mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-24 17:06:53 +01:00
Model downloader: Take HF_ENDPOINT in consideration (#5571)
This commit is contained in:
parent
70c637bf90
commit
a90509d82e
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user