mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 21:38:43 +00:00
fix: improve katex render performance in responses
This commit is contained in:
parent
488f448f04
commit
06a6136671
@ -7,7 +7,7 @@ SET "SCRIPT_DIR=%~dp0"
|
|||||||
cd /d "%SCRIPT_DIR%" || exit /b
|
cd /d "%SCRIPT_DIR%" || exit /b
|
||||||
|
|
||||||
SET "KEY_FILE=.webui_secret_key"
|
SET "KEY_FILE=.webui_secret_key"
|
||||||
SET "PORT=%PORT:8080%"
|
IF "%PORT%"=="" SET PORT=8080
|
||||||
SET "WEBUI_SECRET_KEY=%WEBUI_SECRET_KEY%"
|
SET "WEBUI_SECRET_KEY=%WEBUI_SECRET_KEY%"
|
||||||
SET "WEBUI_JWT_SECRET_KEY=%WEBUI_JWT_SECRET_KEY%"
|
SET "WEBUI_JWT_SECRET_KEY=%WEBUI_JWT_SECRET_KEY%"
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
import { onMount, tick, getContext } from 'svelte';
|
import { onMount, tick, getContext } from 'svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
let componentRoot: HTMLElement;
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
@ -133,7 +134,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderLatex = () => {
|
const renderLatex = () => {
|
||||||
let chatMessageElements = document.getElementsByClassName('chat-assistant');
|
let chatMessageElements = componentRoot.getElementsByClassName('chat-assistant');
|
||||||
// let lastChatMessageElement = chatMessageElements[chatMessageElements.length - 1];
|
// let lastChatMessageElement = chatMessageElements[chatMessageElements.length - 1];
|
||||||
|
|
||||||
for (const element of chatMessageElements) {
|
for (const element of chatMessageElements) {
|
||||||
@ -322,7 +323,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key message.id}
|
{#key message.id}
|
||||||
<div class=" flex w-full message-{message.id}">
|
<div class=" flex w-full message-{message.id}" bind:this={componentRoot}>
|
||||||
<ProfileImage
|
<ProfileImage
|
||||||
src={modelfiles[message.model]?.imageUrl ?? `${WEBUI_BASE_URL}/static/favicon.png`}
|
src={modelfiles[message.model]?.imageUrl ?? `${WEBUI_BASE_URL}/static/favicon.png`}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user