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
orangecat
ollama
Commits
af4cf558
Unverified
Commit
af4cf558
authored
Oct 06, 2023
by
Bruce MacDonald
Committed by
GitHub
Oct 06, 2023
Browse files
not found error before pulling model (#718)
parent
d6786f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
server/routes.go
server/routes.go
+7
-0
No files found.
server/routes.go
View file @
af4cf558
...
...
@@ -3,8 +3,10 @@ package server
import
(
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/fs"
"log"
"net"
"net/http"
...
...
@@ -170,6 +172,11 @@ func GenerateHandler(c *gin.Context) {
model
,
err
:=
GetModel
(
req
.
Model
)
if
err
!=
nil
{
var
pErr
*
fs
.
PathError
if
errors
.
As
(
err
,
&
pErr
)
{
c
.
JSON
(
http
.
StatusNotFound
,
gin
.
H
{
"error"
:
fmt
.
Sprintf
(
"model '%s' not found, try pulling it first"
,
req
.
Model
)})
return
}
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
...
...
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