mirror of
https://github.com/ollama/ollama.git
synced 2025-09-06 06:51:19 +02:00
save file as model name
This commit is contained in:
@@ -49,12 +49,10 @@ def pull(remote, models_home=".", *args, **kwargs):
|
|||||||
if file_info.get("type") == "file" and file_info.get("path").endswith(".bin"):
|
if file_info.get("type") == "file" and file_info.get("path").endswith(".bin"):
|
||||||
f_path = file_info.get("path")
|
f_path = file_info.get("path")
|
||||||
download_url = f"https://huggingface.co/{model}/resolve/{branch}/{f_path}"
|
download_url = f"https://huggingface.co/{model}/resolve/{branch}/{f_path}"
|
||||||
local_filename = os.path.join(
|
local_filename = os.path.join(models_home, os.path.basename(model)) + ".bin"
|
||||||
models_home, os.path.basename(file_info.get("path"))
|
|
||||||
)
|
|
||||||
|
|
||||||
if os.path.exists(local_filename):
|
if os.path.exists(local_filename):
|
||||||
# TODO: check if the file is the same
|
# TODO: check if the file is the same SHA
|
||||||
break
|
break
|
||||||
|
|
||||||
response = requests.get(download_url, stream=True)
|
response = requests.get(download_url, stream=True)
|
||||||
|
Reference in New Issue
Block a user