mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-23 00:18:20 +01:00
Fix the download script (sort of)
This commit is contained in:
parent
bcea196c9d
commit
7c70e0e2a6
@ -102,8 +102,8 @@ def get_download_links_from_huggingface(model, branch):
|
|||||||
content = requests.get(f"{base}{page}").content
|
content = requests.get(f"{base}{page}").content
|
||||||
dict = json.loads(content)
|
dict = json.loads(content)
|
||||||
|
|
||||||
for i in range(len(dict['items'])):
|
for i in range(len(dict)):
|
||||||
fname = dict['items'][i]['path']
|
fname = dict[i]['path']
|
||||||
|
|
||||||
is_pytorch = re.match("pytorch_model.*\.bin", fname)
|
is_pytorch = re.match("pytorch_model.*\.bin", fname)
|
||||||
is_safetensors = re.match("model.*\.safetensors", fname)
|
is_safetensors = re.match("model.*\.safetensors", fname)
|
||||||
@ -123,7 +123,8 @@ def get_download_links_from_huggingface(model, branch):
|
|||||||
has_pytorch = True
|
has_pytorch = True
|
||||||
classifications.append('pytorch')
|
classifications.append('pytorch')
|
||||||
|
|
||||||
page = dict['nextUrl']
|
#page = dict['nextUrl']
|
||||||
|
page = None
|
||||||
|
|
||||||
# If both pytorch and safetensors are available, download safetensors only
|
# If both pytorch and safetensors are available, download safetensors only
|
||||||
if has_pytorch and has_safetensors:
|
if has_pytorch and has_safetensors:
|
||||||
|
Loading…
Reference in New Issue
Block a user