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
9b12a511
Commit
9b12a511
authored
Sep 22, 2023
by
Jeffrey Morgan
Browse files
check other request fields before load short circuit in `/api/generate`
parent
e20362e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
server/routes.go
server/routes.go
+2
-1
No files found.
server/routes.go
View file @
9b12a511
...
...
@@ -223,7 +223,8 @@ func GenerateHandler(c *gin.Context) {
ch
<-
r
}
if
req
.
Prompt
==
""
{
// an empty request loads the model
if
req
.
Prompt
==
""
&&
req
.
Template
==
""
&&
req
.
System
==
""
{
ch
<-
api
.
GenerateResponse
{
Model
:
req
.
Model
,
Done
:
true
}
}
else
{
if
err
:=
loaded
.
llm
.
Predict
(
c
.
Request
.
Context
(),
req
.
Context
,
prompt
,
fn
);
err
!=
nil
{
...
...
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