From 7c70e0e2a673b7fc4e82977c93ac2dc507c861cc Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 2 Mar 2023 14:05:21 -0300 Subject: [PATCH] Fix the download script (sort of) --- download-model.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/download-model.py b/download-model.py index a26ab8f4..599418fc 100644 --- a/download-model.py +++ b/download-model.py @@ -102,8 +102,8 @@ def get_download_links_from_huggingface(model, branch): content = requests.get(f"{base}{page}").content dict = json.loads(content) - for i in range(len(dict['items'])): - fname = dict['items'][i]['path'] + for i in range(len(dict)): + fname = dict[i]['path'] is_pytorch = re.match("pytorch_model.*\.bin", fname) is_safetensors = re.match("model.*\.safetensors", fname) @@ -123,7 +123,8 @@ def get_download_links_from_huggingface(model, branch): has_pytorch = True classifications.append('pytorch') - page = dict['nextUrl'] + #page = dict['nextUrl'] + page = None # If both pytorch and safetensors are available, download safetensors only if has_pytorch and has_safetensors: