only extract timings when it's enabled

This commit is contained in:
Xuan Son Nguyen 2024-12-11 20:32:24 +01:00
parent 10f773415c
commit ab1f7e0326
2 changed files with 2 additions and 2 deletions

View file

@ -252,7 +252,7 @@
<vue-markdown v-else :source="msg.content"></vue-markdown>
<!-- render timings if enabled -->
<div class="dropdown dropdown-hover dropdown-top mt-2" v-if="timings && config.showTokensPerSecond">
<div tabindex="0" role="button" class="cursor-pointer font-semibold text-sm opacity-70">Speed: {{ timings.predicted_per_second.toFixed(1) }} t/s</div>
<div tabindex="0" role="button" class="cursor-pointer font-semibold text-sm opacity-60">Speed: {{ timings.predicted_per_second.toFixed(1) }} t/s</div>
<div class="dropdown-content bg-base-100 z-10 w-64 p-2 shadow mt-4">
<b>Prompt</b><br/>
- Tokens: {{ timings.prompt_n }}<br/>

View file

@ -416,7 +416,7 @@ const mainApp = createApp({
};
}
const timings = chunk.timings;
if (timings) {
if (timings && this.config.showTokensPerSecond) {
// only extract what's really needed, to save some space
this.pendingMsg.timings = {
prompt_n: timings.prompt_n,