mirror of
https://github.com/ollama/ollama.git
synced 2025-03-26 17:51:48 +01:00
desktop: fix response parsing
This commit is contained in:
parent
01d2667f8b
commit
1459ffc9f3
@ -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…
x
Reference in New Issue
Block a user