Fix message timer showing NaN in some cases

This commit is contained in:
Cohee
2023-11-20 22:53:51 +02:00
parent ac4b673c5a
commit f60e74fbd9

View File

@ -1928,6 +1928,10 @@ function formatGenerationTimer(gen_started, gen_finished, tokenCount) {
tokenCount > 0 ? `Token rate: ${Number(tokenCount / seconds).toFixed(1)} t/s` : '', tokenCount > 0 ? `Token rate: ${Number(tokenCount / seconds).toFixed(1)} t/s` : '',
].join('\n'); ].join('\n');
if (isNaN(seconds)) {
return { timerValue: '', timerTitle };
}
return { timerValue, timerTitle }; return { timerValue, timerTitle };
} }