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
1459ffc9
Commit
1459ffc9
authored
Jun 27, 2023
by
Jeffrey Morgan
Browse files
desktop: fix response parsing
parent
01d2667f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
desktop/src/app.tsx
desktop/src/app.tsx
+2
-1
No files found.
desktop/src/app.tsx
View file @
1459ffc9
...
@@ -39,7 +39,8 @@ async function generate(prompt: string, model: string, callback: (res: string) =
...
@@ -39,7 +39,8 @@ async function generate(prompt: string, model: string, callback: (res: string) =
let
decoder
=
new
TextDecoder
()
let
decoder
=
new
TextDecoder
()
let
str
=
decoder
.
decode
(
value
)
let
str
=
decoder
.
decode
(
value
)
let
re
=
/}{/g
let
re
=
/}
\s
*{/g
str
=
'
[
'
+
str
.
replace
(
re
,
'
},{
'
)
+
'
]
'
str
=
'
[
'
+
str
.
replace
(
re
,
'
},{
'
)
+
'
]
'
let
messages
=
JSON
.
parse
(
str
)
let
messages
=
JSON
.
parse
(
str
)
...
...
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