Unverified Commit 92c98eda authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #1781 from open-webui/dev

0.1.122
parents 1092ee9c 85df019c
...@@ -365,7 +365,13 @@ ...@@ -365,7 +365,13 @@
model: model, model: model,
messages: messagesBody, messages: messagesBody,
options: { options: {
...($settings.options ?? {}) ...($settings.options ?? {}),
stop:
$settings?.options?.stop ?? undefined
? $settings.options.stop.map((str) =>
decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"'))
)
: undefined
}, },
format: $settings.requestFormat ?? undefined, format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined, keep_alive: $settings.keepAlive ?? undefined,
...@@ -544,7 +550,7 @@ ...@@ -544,7 +550,7 @@
console.log(docs); console.log(docs);
const res = await generateOpenAIChatCompletion( const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token, localStorage.token,
{ {
model: model.id, model: model.id,
...@@ -588,7 +594,12 @@ ...@@ -588,7 +594,12 @@
}) })
})), })),
seed: $settings?.options?.seed ?? undefined, seed: $settings?.options?.seed ?? undefined,
stop: $settings?.options?.stop ?? undefined, stop:
$settings?.options?.stop ?? undefined
? $settings.options.stop.map((str) =>
decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"'))
)
: undefined,
temperature: $settings?.options?.temperature ?? undefined, temperature: $settings?.options?.temperature ?? undefined,
top_p: $settings?.options?.top_p ?? undefined, top_p: $settings?.options?.top_p ?? undefined,
num_ctx: $settings?.options?.num_ctx ?? undefined, num_ctx: $settings?.options?.num_ctx ?? undefined,
...@@ -620,6 +631,11 @@ ...@@ -620,6 +631,11 @@
if (done || stopResponseFlag || _chatId !== $chatId) { if (done || stopResponseFlag || _chatId !== $chatId) {
responseMessage.done = true; responseMessage.done = true;
messages = messages; messages = messages;
if (stopResponseFlag) {
controller.abort('User: Stop Response');
}
break; break;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
}); });
if (success) { if (success) {
toast.success($i18n.t(`Deleted {tagName}`, { tagName })); toast.success($i18n.t(`Deleted {{tagName}}`, { tagName }));
} }
return success; return success;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
const textCompletionHandler = async () => { const textCompletionHandler = async () => {
const model = $models.find((model) => model.id === selectedModelId); const model = $models.find((model) => model.id === selectedModelId);
const res = await generateOpenAIChatCompletion( const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token, localStorage.token,
{ {
model: model.id, model: model.id,
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
const { value, done } = await reader.read(); const { value, done } = await reader.read();
if (done || stopResponseFlag) { if (done || stopResponseFlag) {
if (stopResponseFlag) { if (stopResponseFlag) {
await cancelOllamaRequest(localStorage.token, currentRequestId); controller.abort('User: Stop Response');
} }
currentRequestId = null; currentRequestId = null;
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
const chatCompletionHandler = async () => { const chatCompletionHandler = async () => {
const model = $models.find((model) => model.id === selectedModelId); const model = $models.find((model) => model.id === selectedModelId);
const res = await generateOpenAIChatCompletion( const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token, localStorage.token,
{ {
model: model.id, model: model.id,
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
const { value, done } = await reader.read(); const { value, done } = await reader.read();
if (done || stopResponseFlag) { if (done || stopResponseFlag) {
if (stopResponseFlag) { if (stopResponseFlag) {
await cancelOllamaRequest(localStorage.token, currentRequestId); controller.abort('User: Stop Response');
} }
currentRequestId = null; currentRequestId = null;
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
import { getBackendConfig } from '$lib/apis'; import { getBackendConfig } from '$lib/apis';
import { getSessionUser } from '$lib/apis/auths'; import { getSessionUser } from '$lib/apis/auths';
import '../app.css';
import '../tailwind.css'; import '../tailwind.css';
import '../app.css';
import 'tippy.js/dist/tippy.css'; import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants';
import i18n, { initI18n } from '$lib/i18n'; import i18n, { initI18n } from '$lib/i18n';
...@@ -60,6 +62,8 @@ ...@@ -60,6 +62,8 @@
} }
await tick(); await tick();
document.getElementById('splash-screen')?.remove();
loaded = true; loaded = true;
}); });
</script> </script>
...@@ -68,8 +72,10 @@ ...@@ -68,8 +72,10 @@
<title>{$WEBUI_NAME}</title> <title>{$WEBUI_NAME}</title>
<link rel="icon" href="{WEBUI_BASE_URL}/static/favicon.png" /> <link rel="icon" href="{WEBUI_BASE_URL}/static/favicon.png" />
<link rel="stylesheet" type="text/css" href="/themes/rosepine.css" /> <!-- rosepine themes have been disabled as it's not up to date with our latest version. -->
<link rel="stylesheet" type="text/css" href="/themes/rosepine-dawn.css" /> <!-- feel free to make a PR to fix if anyone wants to see it return -->
<!-- <link rel="stylesheet" type="text/css" href="/themes/rosepine.css" />
<link rel="stylesheet" type="text/css" href="/themes/rosepine-dawn.css" /> -->
</svelte:head> </svelte:head>
{#if loaded} {#if loaded}
......
...@@ -215,6 +215,8 @@ ...@@ -215,6 +215,8 @@
<style> <style>
.font-mona { .font-mona {
font-family: 'Mona Sans'; font-family: 'Mona Sans', -apple-system, 'Arimo', ui-sans-serif, system-ui, 'Segoe UI', Roboto,
Ubuntu, Cantarell, 'Noto Sans', sans-serif, 'Helvetica Neue', Arial, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
} }
</style> </style>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment