From 43883d260185b42dc94880af7a8053ea6fc6c2a8 Mon Sep 17 00:00:00 2001 From: neCo <50079394+neCo2@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:26:53 +0200 Subject: [PATCH] Fix Uncaught TypeError: chunk.completion_probabilities[0] is undefined in Chat Mode --- mikupad.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mikupad.html b/mikupad.html index 41aa576..a5f0cf9 100644 --- a/mikupad.html +++ b/mikupad.html @@ -1354,7 +1354,7 @@ if (!res.ok) throw new Error(`HTTP ${res.status}`); for await (const chunk of parseEventStream(res.body)) { - const probs = chunk.completion_probabilities[0].probs; + const probs = chunk.completion_probabilities[0]?.probs; const prob = probs?.find(p => p.tok_str === chunk.content)?.prob; yield { content: chunk.content,