diff --git a/desktop/src/app.tsx b/desktop/src/app.tsx index 0a5e5bc7..380709f9 100644 --- a/desktop/src/app.tsx +++ b/desktop/src/app.tsx @@ -46,11 +46,12 @@ async function generate(prompt: string, model: string, callback: (res: string) = for (const message of messages) { const choice = message.choices[0] + + callback(choice.text) + if (choice.finish_reason === 'stop') { break } - - callback(choice.text) } }