From 665ba90d34a85a9cb85cff554745ac637e0d5380 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 14 Dec 2023 18:19:50 -0800 Subject: [PATCH] feat: readable verbose output --- src/lib/components/chat/Messages.svelte | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 5b04f7ae9..c6d534249 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -35,16 +35,26 @@ if (message.info) { tippy(`#info-${message.id}`, { content: `token/s: ${ - (message.info.eval_count ?? 0) / message.info.eval_duration ?? 'N/A' + `${ + Math.round( + ((message.info.eval_count ?? 0) / (message.info.eval_duration / 1000000000)) * 100 + ) / 100 + } tokens` ?? 'N/A' }
- total_duration: ${message.info.total_duration ?? 'N/A'}
- load_duration: ${message.info.load_duration ?? 'N/A'}
- sample_count: ${message.info.sample_count ?? 'N/A'}
- sample_duration: ${message.info.sample_duration ?? 'N/A'}
+ total_duration: ${ + Math.round(((message.info.total_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A' + }ms
+ load_duration: ${ + Math.round(((message.info.load_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A' + }ms
prompt_eval_count: ${message.info.prompt_eval_count ?? 'N/A'}
- prompt_eval_duration: ${message.info.prompt_eval_duration ?? 'N/A'}
+ prompt_eval_duration: ${ + Math.round(((message.info.prompt_eval_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A' + }ms
eval_count: ${message.info.eval_count ?? 'N/A'}
- eval_duration: ${message.info.eval_duration ?? 'N/A'}
`, + eval_duration: ${ + Math.round(((message.info.eval_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A' + }ms`, allowHTML: true }); }