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
f20426a7
Commit
f20426a7
authored
Jul 18, 2023
by
Michael Yang
Browse files
fix mkdir blob path
parent
a9cc270b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
16 deletions
+2
-16
cmd/cmd.go
cmd/cmd.go
+0
-14
server/modelpath.go
server/modelpath.go
+2
-2
No files found.
cmd/cmd.go
View file @
f20426a7
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"net"
"net"
"net/http"
"net/http"
"os"
"os"
"path/filepath"
"strings"
"strings"
"time"
"time"
...
@@ -24,15 +23,6 @@ import (
...
@@ -24,15 +23,6 @@ import (
"github.com/jmorganca/ollama/server"
"github.com/jmorganca/ollama/server"
)
)
func
cacheDir
()
string
{
home
,
err
:=
os
.
UserHomeDir
()
if
err
!=
nil
{
panic
(
err
)
}
return
filepath
.
Join
(
home
,
".ollama"
)
}
func
create
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
func
create
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
filename
,
_
:=
cmd
.
Flags
()
.
GetString
(
"file"
)
filename
,
_
:=
cmd
.
Flags
()
.
GetString
(
"file"
)
client
:=
api
.
NewClient
()
client
:=
api
.
NewClient
()
...
@@ -292,10 +282,6 @@ func NewCLI() *cobra.Command {
...
@@ -292,10 +282,6 @@ func NewCLI() *cobra.Command {
CompletionOptions
:
cobra
.
CompletionOptions
{
CompletionOptions
:
cobra
.
CompletionOptions
{
DisableDefaultCmd
:
true
,
DisableDefaultCmd
:
true
,
},
},
PersistentPreRunE
:
func
(
_
*
cobra
.
Command
,
args
[]
string
)
error
{
// create the models directory and it's parent
return
os
.
MkdirAll
(
filepath
.
Join
(
cacheDir
(),
"models"
),
0
o700
)
},
}
}
cobra
.
EnableCommandSorting
=
false
cobra
.
EnableCommandSorting
=
false
...
...
server/modelpath.go
View file @
f20426a7
...
@@ -106,10 +106,10 @@ func GetBlobsPath(digest string) (string, error) {
...
@@ -106,10 +106,10 @@ func GetBlobsPath(digest string) (string, error) {
return
""
,
err
return
""
,
err
}
}
path
:=
filepath
.
Join
(
home
,
".ollama"
,
"models"
,
"blobs"
)
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
}
}
return
filepath
.
Join
(
path
,
digest
)
,
nil
return
path
,
nil
}
}
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