desktop: fix response parsing
This commit is contained in:
parent
01d2667f8b
commit
1459ffc9f3
1 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,8 @@ async function generate(prompt: string, model: string, callback: (res: string) =
|
|||
|
||||
let decoder = new TextDecoder()
|
||||
let str = decoder.decode(value)
|
||||
let re = /}{/g
|
||||
|
||||
let re = /}\s*{/g
|
||||
str = '[' + str.replace(re, '},{') + ']'
|
||||
let messages = JSON.parse(str)
|
||||
|
||||
|
|
Loading…
Reference in a new issue