From 536ff4d816ac90364e1f42157b5c53c6bf96261d Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Wed, 28 Jun 2023 14:26:19 -0400 Subject: [PATCH] save file as model name --- ollama/model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ollama/model.py b/ollama/model.py index 0d240432..e14faeec 100644 --- a/ollama/model.py +++ b/ollama/model.py @@ -49,12 +49,10 @@ def pull(remote, models_home=".", *args, **kwargs): if file_info.get("type") == "file" and file_info.get("path").endswith(".bin"): f_path = file_info.get("path") download_url = f"https://huggingface.co/{model}/resolve/{branch}/{f_path}" - local_filename = os.path.join( - models_home, os.path.basename(file_info.get("path")) - ) + local_filename = os.path.join(models_home, os.path.basename(model)) + ".bin" if os.path.exists(local_filename): - # TODO: check if the file is the same + # TODO: check if the file is the same SHA break response = requests.get(download_url, stream=True)