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
51164f57
"docs/git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "4d8f132a78c47de7b9d9d69920a6544d8f788bf6"
Commit
51164f57
authored
Jun 25, 2023
by
Jeffrey Morgan
Browse files
add `GET /models` endpoint
parent
6ba93652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
proto.py
proto.py
+6
-0
No files found.
proto.py
View file @
51164f57
...
@@ -74,6 +74,12 @@ def generate():
...
@@ -74,6 +74,12 @@ def generate():
stream_with_context
(
stream_response
()),
mimetype
=
"text/event-stream"
stream_with_context
(
stream_response
()),
mimetype
=
"text/event-stream"
)
)
@
app
.
route
(
"/models"
,
methods
=
[
"GET"
])
def
models
():
all_files
=
os
.
listdir
(
"./models"
)
bin_files
=
[
file
.
replace
(
".bin"
,
""
)
for
file
in
all_files
if
file
.
endswith
(
".bin"
)]
return
Response
(
json
.
dumps
(
bin_files
),
mimetype
=
"application/json"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
app
.
run
(
debug
=
True
,
threaded
=
True
,
port
=
5001
)
app
.
run
(
debug
=
True
,
threaded
=
True
,
port
=
5001
)
app
.
run
()
app
.
run
()
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