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
76fb9eea
Commit
76fb9eea
authored
Jun 30, 2023
by
Michael Yang
Browse files
use Path / operator
parent
3ce3caaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ollama/engine.py
ollama/engine.py
+1
-1
ollama/model.py
ollama/model.py
+2
-2
No files found.
ollama/engine.py
View file @
76fb9eea
...
...
@@ -30,7 +30,7 @@ def load(model_name, models={}):
if
not
models
.
get
(
model_name
,
None
):
model_path
=
path
.
expanduser
(
model_name
)
if
not
path
.
exists
(
model_path
):
model_path
=
path
.
join
(
MODELS_CACHE_PATH
,
model_name
+
".bin"
)
model_path
=
MODELS_CACHE_PATH
/
model_name
+
".bin"
runners
=
{
model_type
:
cls
...
...
ollama/model.py
View file @
76fb9eea
...
...
@@ -7,7 +7,7 @@ from tqdm import tqdm
MODELS_MANIFEST
=
'https://ollama.ai/api/models'
MODELS_CACHE_PATH
=
path
.
join
(
Path
.
home
()
,
'.ollama'
,
'models'
)
MODELS_CACHE_PATH
=
Path
.
home
()
/
'.ollama'
/
'models'
def
models
(
*
args
,
**
kwargs
):
...
...
@@ -78,7 +78,7 @@ def find_bin_file(json_response, location, branch):
def
download_file
(
download_url
,
file_name
,
file_size
):
local_filename
=
path
.
join
(
MODELS_CACHE_PATH
,
file_name
)
+
'.bin'
local_filename
=
MODELS_CACHE_PATH
/
file_name
+
'.bin'
first_byte
=
path
.
getsize
(
local_filename
)
if
path
.
exists
(
local_filename
)
else
0
...
...
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