Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
536ff4d8
Commit
536ff4d8
authored
Jun 28, 2023
by
Bruce MacDonald
Browse files
save file as model name
parent
52beb0a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
ollama/model.py
ollama/model.py
+2
-4
No files found.
ollama/model.py
View file @
536ff4d8
...
@@ -49,12 +49,10 @@ def pull(remote, models_home=".", *args, **kwargs):
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment