From dd1bed2d8bd5ed592ccabeb4264bc1129332cf6a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 7 Jan 2023 16:49:21 -0300 Subject: [PATCH] Fix the download script --- download-model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/download-model.py b/download-model.py index 651b806..3a2fff6 100644 --- a/download-model.py +++ b/download-model.py @@ -27,9 +27,11 @@ def get_file(args): f.write(data) t.close() -model = Path(argv[1]) +model = argv[1] +if model[-1] == '/': + model = model[:-1] url = f'https://huggingface.co/{model}/tree/main' -output_folder = Path("models") / model.name +output_folder = Path("models") / model.split('/')[-1] if not output_folder.exists(): output_folder.mkdir()