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
d017e3d0
Unverified
Commit
d017e3d0
authored
Jan 18, 2024
by
Michael Yang
Committed by
GitHub
Jan 18, 2024
Browse files
Merge pull request #2060 from jmorganca/mxyng/fix-show
fix show handler
parents
1f5b7ff9
aac9ab4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
server/routes.go
server/routes.go
+3
-4
No files found.
server/routes.go
View file @
d017e3d0
...
@@ -630,11 +630,10 @@ func ShowModelHandler(c *gin.Context) {
...
@@ -630,11 +630,10 @@ func ShowModelHandler(c *gin.Context) {
return
return
}
}
var
model
string
if
req
.
Model
!=
""
{
if
req
.
Model
!=
""
{
model
=
req
.
Model
// noop
}
else
if
req
.
Name
!=
""
{
}
else
if
req
.
Name
!=
""
{
m
odel
=
req
.
Name
req
.
M
odel
=
req
.
Name
}
else
{
}
else
{
c
.
AbortWithStatusJSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"model is required"
})
c
.
AbortWithStatusJSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"model is required"
})
return
return
...
@@ -643,7 +642,7 @@ func ShowModelHandler(c *gin.Context) {
...
@@ -643,7 +642,7 @@ func ShowModelHandler(c *gin.Context) {
resp
,
err
:=
GetModelInfo
(
req
)
resp
,
err
:=
GetModelInfo
(
req
)
if
err
!=
nil
{
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
if
os
.
IsNotExist
(
err
)
{
c
.
JSON
(
http
.
StatusNotFound
,
gin
.
H
{
"error"
:
fmt
.
Sprintf
(
"model '%s' not found"
,
m
odel
)})
c
.
JSON
(
http
.
StatusNotFound
,
gin
.
H
{
"error"
:
fmt
.
Sprintf
(
"model '%s' not found"
,
req
.
M
odel
)})
}
else
{
}
else
{
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
}
}
...
...
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