Skip to content

Commit

Permalink
Fix Uncaught TypeError: chunk.completion_probabilities[0] is undefine…
Browse files Browse the repository at this point in the history
…d in Chat Mode
  • Loading branch information
neCo2 authored Jun 3, 2024
1 parent abc77df commit 43883d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mikupad.html
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 43883d2

Please sign in to comment.