lmg-anon / mikupad

LLM Frontend in a single html file
https://lmg-anon.github.io/mikupad/mikupad.html
Creative Commons Zero v1.0 Universal
175 stars 24 forks source link

Fix Uncaught TypeError: chunk.completion_probabilities[0] is undefined in Chat Mode #71

Closed neCo2 closed 1 month ago

neCo2 commented 1 month ago

When chat mode is active, the following error occurs at the end of generation, and the instruct prefix fails to be added to the end of the prompt.

Uncaught TypeError: chunk.completion_probabilities[0] is undefined
    llamaCppCompletion file:///C:/Programs/mikupad/mikupad.html:1357

Changing the operator to optional chaining should take care of the problem.

lmg-anon commented 1 month ago

Thank you for the patch!