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
4ef886b1
Commit
4ef886b1
authored
Jun 27, 2023
by
Jeffrey Morgan
Browse files
desktop: capture text from last chunk of response
parent
ab828602
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
desktop/src/app.tsx
desktop/src/app.tsx
+3
-2
No files found.
desktop/src/app.tsx
View file @
4ef886b1
...
@@ -46,11 +46,12 @@ async function generate(prompt: string, model: string, callback: (res: string) =
...
@@ -46,11 +46,12 @@ async function generate(prompt: string, model: string, callback: (res: string) =
for
(
const
message
of
messages
)
{
for
(
const
message
of
messages
)
{
const
choice
=
message
.
choices
[
0
]
const
choice
=
message
.
choices
[
0
]
callback
(
choice
.
text
)
if
(
choice
.
finish_reason
===
'
stop
'
)
{
if
(
choice
.
finish_reason
===
'
stop
'
)
{
break
break
}
}
callback
(
choice
.
text
)
}
}
}
}
...
...
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