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
a7ee84fc
Commit
a7ee84fc
authored
May 09, 2024
by
Michael Yang
Browse files
routes: skip invalid filepaths
parent
5cde17a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
server/routes.go
server/routes.go
+5
-0
No files found.
server/routes.go
View file @
a7ee84fc
...
@@ -732,6 +732,11 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
...
@@ -732,6 +732,11 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
}
}
n
:=
model
.
ParseNameFromFilepath
(
rel
)
n
:=
model
.
ParseNameFromFilepath
(
rel
)
if
!
n
.
IsValid
()
{
slog
.
Info
(
"invalid model filepath"
,
"path"
,
rel
)
return
nil
}
m
,
err
:=
ParseNamedManifest
(
n
)
m
,
err
:=
ParseNamedManifest
(
n
)
if
err
!=
nil
{
if
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