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
f529626c
Unverified
Commit
f529626c
authored
Jul 31, 2023
by
Bruce MacDonald
Committed by
GitHub
Jul 31, 2023
Browse files
log prediction failures
parents
90ba0b80
671eec6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
server/routes.go
server/routes.go
+3
-0
No files found.
server/routes.go
View file @
f529626c
...
@@ -129,6 +129,7 @@ func GenerateHandler(c *gin.Context) {
...
@@ -129,6 +129,7 @@ func GenerateHandler(c *gin.Context) {
}
}
if
err
:=
activeSession
.
llm
.
Predict
(
req
.
Context
,
prompt
,
fn
);
err
!=
nil
{
if
err
:=
activeSession
.
llm
.
Predict
(
req
.
Context
,
prompt
,
fn
);
err
!=
nil
{
log
.
Printf
(
"llm.Predict failed with %s"
,
err
)
ch
<-
gin
.
H
{
"error"
:
err
.
Error
()}
ch
<-
gin
.
H
{
"error"
:
err
.
Error
()}
}
}
}()
}()
...
@@ -345,11 +346,13 @@ func streamResponse(c *gin.Context, ch chan any) {
...
@@ -345,11 +346,13 @@ func streamResponse(c *gin.Context, ch chan any) {
bts
,
err
:=
json
.
Marshal
(
val
)
bts
,
err
:=
json
.
Marshal
(
val
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"streamResponse: json.Marshal failed with %s"
,
err
)
return
false
return
false
}
}
bts
=
append
(
bts
,
'\n'
)
bts
=
append
(
bts
,
'\n'
)
if
_
,
err
:=
w
.
Write
(
bts
);
err
!=
nil
{
if
_
,
err
:=
w
.
Write
(
bts
);
err
!=
nil
{
log
.
Printf
(
"streamResponse: w.Write failed with %s"
,
err
)
return
false
return
false
}
}
...
...
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