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
0cfdbb95
Unverified
Commit
0cfdbb95
authored
Jul 20, 2023
by
Michael Yang
Committed by
GitHub
Jul 20, 2023
Browse files
Merge pull request #146 from jmorganca/fix-windows-pull
windows: fix model pulling
parents
2832801c
6cea2061
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
server/images.go
server/images.go
+4
-0
server/modelpath.go
server/modelpath.go
+5
-0
No files found.
server/images.go
View file @
0cfdbb95
...
@@ -854,6 +854,10 @@ func downloadBlob(mp ModelPath, digest string, username, password string, fn fun
...
@@ -854,6 +854,10 @@ func downloadBlob(mp ModelPath, digest string, username, password string, fn fun
})
})
if
completed
>=
total
{
if
completed
>=
total
{
if
err
:=
out
.
Close
();
err
!=
nil
{
return
err
}
if
err
:=
os
.
Rename
(
fp
+
"-partial"
,
fp
);
err
!=
nil
{
if
err
:=
os
.
Rename
(
fp
+
"-partial"
,
fp
);
err
!=
nil
{
fn
(
api
.
ProgressResponse
{
fn
(
api
.
ProgressResponse
{
Status
:
fmt
.
Sprintf
(
"error renaming file: %v"
,
err
),
Status
:
fmt
.
Sprintf
(
"error renaming file: %v"
,
err
),
...
...
server/modelpath.go
View file @
0cfdbb95
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"fmt"
"fmt"
"os"
"os"
"path/filepath"
"path/filepath"
"runtime"
"strings"
"strings"
)
)
...
@@ -106,6 +107,10 @@ func GetBlobsPath(digest string) (string, error) {
...
@@ -106,6 +107,10 @@ func GetBlobsPath(digest string) (string, error) {
return
""
,
err
return
""
,
err
}
}
if
runtime
.
GOOS
==
"windows"
{
digest
=
strings
.
ReplaceAll
(
digest
,
":"
,
"-"
)
}
path
:=
filepath
.
Join
(
home
,
".ollama"
,
"models"
,
"blobs"
,
digest
)
path
:=
filepath
.
Join
(
home
,
".ollama"
,
"models"
,
"blobs"
,
digest
)
if
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
path
),
0
o755
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
path
),
0
o755
);
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
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