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
af4cf558
"vscode:/vscode.git/clone" did not exist on "2f4eb4ac2f48a597825d3631a840afd855fe6b39"
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
Show 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
...
@@ -3,8 +3,10 @@ package server
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"errors"
"fmt"
"fmt"
"io"
"io"
"io/fs"
"log"
"log"
"net"
"net"
"net/http"
"net/http"
...
@@ -170,6 +172,11 @@ func GenerateHandler(c *gin.Context) {
...
@@ -170,6 +172,11 @@ func GenerateHandler(c *gin.Context) {
model
,
err
:=
GetModel
(
req
.
Model
)
model
,
err
:=
GetModel
(
req
.
Model
)
if
err
!=
nil
{
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
()})
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
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