mirror of
https://github.com/ollama/ollama.git
synced 2025-08-28 06:47:47 +02:00
desktop: fix response parsing
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user