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
6ba93652
Commit
6ba93652
authored
Jun 25, 2023
by
Jeffrey Morgan
Browse files
fix model lookup directory
parent
0ce372f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
proto.py
proto.py
+2
-2
No files found.
proto.py
View file @
6ba93652
...
...
@@ -52,7 +52,7 @@ def generate():
return
Response
(
"Model is required"
,
status
=
400
)
if
not
prompt
:
return
Response
(
"Prompt is required"
,
status
=
400
)
if
not
os
.
path
.
exists
(
f
".
.
/models/
{
model
}
.bin"
):
if
not
os
.
path
.
exists
(
f
"./models/
{
model
}
.bin"
):
return
{
"error"
:
"The model does not exist."
},
400
if
model
not
in
llms
:
...
...
@@ -74,6 +74,6 @@ def generate():
stream_with_context
(
stream_response
()),
mimetype
=
"text/event-stream"
)
if
__name__
==
"__main__"
:
app
.
run
(
debug
=
True
,
threaded
=
True
,
port
=
5001
)
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