From f60e74fbd9a9979b27f382fc13ebeb9fa2e19bef Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 20 Nov 2023 22:53:51 +0200 Subject: [PATCH] Fix message timer showing NaN in some cases --- public/script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/script.js b/public/script.js index da5439f35..fab6e4783 100644 --- a/public/script.js +++ b/public/script.js @@ -1928,6 +1928,10 @@ function formatGenerationTimer(gen_started, gen_finished, tokenCount) { tokenCount > 0 ? `Token rate: ${Number(tokenCount / seconds).toFixed(1)} t/s` : '', ].join('\n'); + if (isNaN(seconds)) { + return { timerValue: '', timerTitle }; + } + return { timerValue, timerTitle }; }