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
09a6f76f
Commit
09a6f76f
authored
Feb 01, 2024
by
Jeffrey Morgan
Browse files
fix error on `ollama run` with a non-existent model
parent
e1351674
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
cmd/cmd.go
cmd/cmd.go
+6
-0
No files found.
cmd/cmd.go
View file @
09a6f76f
...
@@ -147,6 +147,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
...
@@ -147,6 +147,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
}
}
name
:=
args
[
0
]
name
:=
args
[
0
]
// check if the model exists on the server
// check if the model exists on the server
show
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
api
.
ShowRequest
{
Name
:
name
})
show
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
api
.
ShowRequest
{
Name
:
name
})
var
statusError
api
.
StatusError
var
statusError
api
.
StatusError
...
@@ -155,6 +156,11 @@ func RunHandler(cmd *cobra.Command, args []string) error {
...
@@ -155,6 +156,11 @@ func RunHandler(cmd *cobra.Command, args []string) error {
if
err
:=
PullHandler
(
cmd
,
[]
string
{
name
});
err
!=
nil
{
if
err
:=
PullHandler
(
cmd
,
[]
string
{
name
});
err
!=
nil
{
return
err
return
err
}
}
show
,
err
=
client
.
Show
(
cmd
.
Context
(),
&
api
.
ShowRequest
{
Name
:
name
})
if
err
!=
nil
{
return
err
}
case
err
!=
nil
:
case
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