mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-23 21:18:00 +01:00
Fix download script (#1373)
This commit is contained in:
parent
49aa05054a
commit
69d50e2e86
@ -81,7 +81,7 @@ def sanitize_model_and_branch_names(model, branch):
|
||||
|
||||
def get_download_links_from_huggingface(model, branch, text_only=False):
|
||||
base = "https://huggingface.co"
|
||||
page = f"/api/models/{model}/tree/{branch}?cursor="
|
||||
page = f"/api/models/{model}/tree/{branch}"
|
||||
cursor = b""
|
||||
|
||||
links = []
|
||||
@ -93,7 +93,10 @@ def get_download_links_from_huggingface(model, branch, text_only=False):
|
||||
has_safetensors = False
|
||||
is_lora = False
|
||||
while True:
|
||||
content = requests.get(f"{base}{page}{cursor.decode()}").content
|
||||
url = f"{base}{page}" + (f"?cursor={cursor.decode()}" if cursor else "")
|
||||
r = requests.get(url)
|
||||
r.raise_for_status()
|
||||
content = r.content
|
||||
|
||||
dict = json.loads(content)
|
||||
if len(dict) == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user