Fix logprobs parser on NovelAI non-streaming

This commit is contained in:
Cohee 2024-01-29 11:13:48 +02:00
parent 58086d26ba
commit b4646da187
1 changed files with 5 additions and 0 deletions

View File

@ -374,6 +374,11 @@ function withVirtualWhitespace(text, span) {
* @param {string | null} continueFrom - for 'continue' generations, the prompt
*/
export function saveLogprobsForActiveMessage(logprobs, continueFrom) {
if (!logprobs) {
// non-streaming APIs could return null data
return;
}
convertTokenIdLogprobsToText(logprobs);
const msgId = chat.length - 1;