diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte
index 2ecbd418c..5e8208ebc 100644
--- a/src/lib/components/chat/Messages/ResponseMessage.svelte
+++ b/src/lib/components/chat/Messages/ResponseMessage.svelte
@@ -81,7 +81,6 @@
import 'katex/dist/katex.min.css';
import markedKatex from '$lib/utils/katex-extension';
-
const options = {
throwOnError: false
};
@@ -96,63 +95,9 @@
}
})();
- const renderStyling = async () => {
- await tick();
-
- if (tooltipInstance) {
- tooltipInstance[0]?.destroy();
- }
-
- // renderLatex();
-
- if (message.info) {
- let tooltipContent = '';
- if (message.info.openai) {
- tooltipContent = `prompt_tokens: ${message.info.prompt_tokens ?? 'N/A'}
- completion_tokens: ${message.info.completion_tokens ?? 'N/A'}
- total_tokens: ${message.info.total_tokens ?? 'N/A'}`;
- } else {
- tooltipContent = `response_token/s: ${
- `${
- Math.round(
- ((message.info.eval_count ?? 0) / (message.info.eval_duration / 1000000000)) * 100
- ) / 100
- } tokens` ?? 'N/A'
- }
- prompt_token/s: ${
- Math.round(
- ((message.info.prompt_eval_count ?? 0) /
- (message.info.prompt_eval_duration / 1000000000)) *
- 100
- ) / 100 ?? 'N/A'
- } tokens
- 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: ${
- Math.round(((message.info.prompt_eval_duration ?? 0) / 1000000) * 100) /
- 100 ?? 'N/A'
- }ms
- eval_count: ${message.info.eval_count ?? 'N/A'}
- eval_duration: ${
- Math.round(((message.info.eval_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A'
- }ms
- approximate_total: ${approximateToHumanReadable(message.info.total_duration)}`;
- }
- tooltipInstance = tippy(`#info-${message.id}`, {
- content: `${tooltipContent}`,
- allowHTML: true,
- theme: 'dark',
- arrow: false,
- offset: [0, 4]
- });
- }
- };
+ $: if (message?.done ?? false) {
+ renderLatex();
+ }
const renderLatex = () => {
let chatMessageElements = document
@@ -845,31 +790,71 @@
{/if}
{#if message.info}
-
-
+
{/if}