From 7f6dae41f02c11f1ebb7436b061c2d31025c1752 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Sat, 7 Sep 2024 17:21:17 +0200 Subject: [PATCH 001/143] More options for AUTOMATIC1111 This commit adds 3 new options to the AUTOMATIC1111 settings: - CFG Scale - Sampler - Scheduler These options allow users to configure these parameters directly through the admin settings, without needing to modify the source code, which was previously required to change the default values in AUTOMATIC1111. Signed-off-by: Balazs Toldi --- backend/open_webui/apps/images/main.py | 31 +++++++++ backend/open_webui/config.py | 18 ++++++ .../components/admin/Settings/Images.svelte | 64 +++++++++++++++++++ src/lib/i18n/locales/en-US/translation.json | 6 ++ 4 files changed, 119 insertions(+) diff --git a/backend/open_webui/apps/images/main.py b/backend/open_webui/apps/images/main.py index 17afd645c..773a685d9 100644 --- a/backend/open_webui/apps/images/main.py +++ b/backend/open_webui/apps/images/main.py @@ -17,6 +17,9 @@ from open_webui.apps.images.utils.comfyui import ( from open_webui.config import ( AUTOMATIC1111_API_AUTH, AUTOMATIC1111_BASE_URL, + AUTOMATIC1111_CFG_SCALE, + AUTOMATIC1111_SAMPLER, + AUTOMATIC1111_SCHEDULER, CACHE_DIR, COMFYUI_BASE_URL, COMFYUI_WORKFLOW, @@ -65,6 +68,9 @@ app.state.config.MODEL = IMAGE_GENERATION_MODEL app.state.config.AUTOMATIC1111_BASE_URL = AUTOMATIC1111_BASE_URL app.state.config.AUTOMATIC1111_API_AUTH = AUTOMATIC1111_API_AUTH +app.state.config.AUTOMATIC1111_CFG_SCALE = AUTOMATIC1111_CFG_SCALE +app.state.config.AUTOMATIC1111_SAMPLER = AUTOMATIC1111_SAMPLER +app.state.config.AUTOMATIC1111_SCHEDULER = AUTOMATIC1111_SCHEDULER app.state.config.COMFYUI_BASE_URL = COMFYUI_BASE_URL app.state.config.COMFYUI_WORKFLOW = COMFYUI_WORKFLOW app.state.config.COMFYUI_WORKFLOW_NODES = COMFYUI_WORKFLOW_NODES @@ -85,6 +91,9 @@ async def get_config(request: Request, user=Depends(get_admin_user)): "automatic1111": { "AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL, "AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH, + "AUTOMATIC1111_CFG_SCALE": app.state.config.AUTOMATIC1111_CFG_SCALE, + "AUTOMATIC1111_SAMPLER": app.state.config.AUTOMATIC1111_SAMPLER, + "AUTOMATIC1111_SCHEDULER": app.state.config.AUTOMATIC1111_SCHEDULER, }, "comfyui": { "COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL, @@ -102,6 +111,9 @@ class OpenAIConfigForm(BaseModel): class Automatic1111ConfigForm(BaseModel): AUTOMATIC1111_BASE_URL: str AUTOMATIC1111_API_AUTH: str + AUTOMATIC1111_CFG_SCALE: float + AUTOMATIC1111_SAMPLER: str + AUTOMATIC1111_SCHEDULER: str class ComfyUIConfigForm(BaseModel): @@ -132,6 +144,12 @@ async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)): app.state.config.AUTOMATIC1111_API_AUTH = ( form_data.automatic1111.AUTOMATIC1111_API_AUTH ) + app.state.config.AUTOMATIC1111_CFG_SCALE = form_data.automatic1111.AUTOMATIC1111_CFG_SCALE + app.state.config.AUTOMATIC1111_SAMPLER = form_data.automatic1111.AUTOMATIC1111_SAMPLER + app.state.config.AUTOMATIC1111_SCHEDULER = ( + form_data.automatic1111.AUTOMATIC1111_SCHEDULER + ) + app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/") app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW @@ -147,6 +165,9 @@ async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)): "automatic1111": { "AUTOMATIC1111_BASE_URL": app.state.config.AUTOMATIC1111_BASE_URL, "AUTOMATIC1111_API_AUTH": app.state.config.AUTOMATIC1111_API_AUTH, + "AUTOMATIC1111_CFG_SCALE": app.state.config.AUTOMATIC1111_CFG_SCALE, + "AUTOMATIC1111_SAMPLER": app.state.config.AUTOMATIC1111_SAMPLER, + "AUTOMATIC1111_SCHEDULER": app.state.config.AUTOMATIC1111_SCHEDULER, }, "comfyui": { "COMFYUI_BASE_URL": app.state.config.COMFYUI_BASE_URL, @@ -266,6 +287,7 @@ async def update_image_config(form_data: ImageConfigForm, user=Depends(get_admin detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 50)."), ) + return { "MODEL": app.state.config.MODEL, "IMAGE_SIZE": app.state.config.IMAGE_SIZE, @@ -523,6 +545,15 @@ async def image_generations( if form_data.negative_prompt is not None: data["negative_prompt"] = form_data.negative_prompt + + if app.state.config.AUTOMATIC1111_CFG_SCALE: + data["cfg_scale"] = app.state.config.AUTOMATIC1111_CFG_SCALE + + if app.state.config.AUTOMATIC1111_SAMPLER: + data["sampler_name"] = app.state.config.AUTOMATIC1111_SAMPLER + + if app.state.config.AUTOMATIC1111_SCHEDULER: + data["scheduler"] = app.state.config.AUTOMATIC1111_SCHEDULER # Use asyncio.to_thread for the requests.post call r = await asyncio.to_thread( diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 5ccb40d47..e252a0dbb 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1267,6 +1267,24 @@ AUTOMATIC1111_API_AUTH = PersistentConfig( os.getenv("AUTOMATIC1111_API_AUTH", ""), ) +AUTOMATIC1111_CFG_SCALE = PersistentConfig( + "AUTOMATIC1111_CFG_SCALE", + "image_generation.automatic1111.cfg_scale", + float(os.getenv("AUTOMATIC1111_CFG_SCALE", 7.0)), +) + +AUTOMATIC1111_SAMPLER = PersistentConfig( + "AUTOMATIC1111_SAMPLERE", + "image_generation.automatic1111.sampler", + os.getenv("AUTOMATIC1111_SAMPLER", "Euler"), +) + +AUTOMATIC1111_SCHEDULER = PersistentConfig( + "AUTOMATIC1111_SCHEDULER", + "image_generation.automatic1111.scheduler", + os.getenv("AUTOMATIC1111_SCHEDULER", "Automatic"), +) + COMFYUI_BASE_URL = PersistentConfig( "COMFYUI_BASE_URL", "image_generation.comfyui.base_url", diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index 91ce4f280..55afda25b 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -27,6 +27,10 @@ let models = null; + let samplers = ["DPM++ 2M", "DPM++ SDE", "DPM++ 2M SDE", "DPM++ 2M SDE Heun", "DPM++ 2S a", "DPM++ 3M SDE", "Euler a", "Euler", "LMS", "Heun", "DPM2", "DPM2 a", "DPM fast", "DPM adaptive", "Restart", "DDIM", "DDIM CFG++", "PLMS", "UniPC"]; + + let schedulers = ["Automatic", "Uniform", "Karras", "Exponential", "Polyexponential", "SGM Uniform", "KL Optimal", "Align Your Steps", "Simple", "Normal", "DDIM", "Beta"]; + let requiredWorkflowNodes = [ { type: 'prompt', @@ -326,6 +330,66 @@ + + +
+
{$i18n.t('Set Sampler')}
+
+
+ + + + + {#each samplers ?? [] as sampler} + + {/each} + + +
+
+
+ +
+
{$i18n.t('Set Scheduler')}
+
+
+ + + + + {#each schedulers ?? [] as scheduler} + + {/each} + + +
+
+
+ +
+
{$i18n.t('Set CFG Scale')}
+
+
+ + + +
+
+
{:else if config?.engine === 'comfyui'}
{$i18n.t('ComfyUI Base URL')}
diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index ea56eb344..cbfa7e34a 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "", "Enter Chunk Size": "", "Enter Github Raw URL": "", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "", "Enter Number of Steps (e.g. 50)": "", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "", "Server connection verified": "", "Set as default": "", + "Set CFG Scale": "", "Set Default Model": "", "Set embedding model (e.g. {{model}})": "", "Set Image Size": "", "Set reranking model (e.g. {{model}})": "", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "", "Set Task Model": "", "Set Voice": "", From cc1d3c48e0568bcfd532637ed7b4351223da5982 Mon Sep 17 00:00:00 2001 From: Karl Lee <61072264+KarlLee830@users.noreply.github.com> Date: Sun, 8 Sep 2024 16:51:14 +0800 Subject: [PATCH 002/143] i18n: Update Chinese translation --- src/lib/i18n/locales/zh-CN/translation.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/i18n/locales/zh-CN/translation.json b/src/lib/i18n/locales/zh-CN/translation.json index bd757bf0b..c5fc4ae41 100644 --- a/src/lib/i18n/locales/zh-CN/translation.json +++ b/src/lib/i18n/locales/zh-CN/translation.json @@ -9,7 +9,7 @@ "{{user}}'s Chats": "{{user}} 的对话记录", "{{webUIName}} Backend Required": "需要 {{webUIName}} 后端", "*Prompt node ID(s) are required for image generation": "*图片生成需要 Prompt node ID", - "A task model is used when performing tasks such as generating titles for chats and web search queries": "任务模型用于执行生成对话标题和网络搜索查询等任务", + "A task model is used when performing tasks such as generating titles for chats and web search queries": "任务模型用于执行生成对话标题和联网搜索查询等任务", "a user": "用户", "About": "关于", "Account": "账号", @@ -229,8 +229,8 @@ "Enable Community Sharing": "启用分享至社区", "Enable Message Rating": "启用消息评价", "Enable New Sign Ups": "允许新用户注册", - "Enable Web Search": "启用网络搜索", - "Enable Web Search Query Generation": "", + "Enable Web Search": "启用联网搜索", + "Enable Web Search Query Generation": "启用生成联网搜索关键词", "Enabled": "启用", "Engine": "引擎", "Ensure your CSV file includes 4 columns in this order: Name, Email, Password, Role.": "确保您的 CSV 文件按以下顺序包含 4 列: 姓名、电子邮箱、密码、角色。", @@ -368,7 +368,7 @@ "Last Active": "最后在线时间", "Last Modified": "最后修改时间", "Leave empty for unlimited": "留空表示无限制", - "Leave empty to use the default prompt, or enter a custom prompt": "", + "Leave empty to use the default prompt, or enter a custom prompt": "留空以使用默认提示词,或输入自定义提示词。", "Light": "浅色", "Listening...": "正在倾听...", "LLMs can make mistakes. Verify important information.": "大语言模型可能会生成误导性错误信息,请对关键信息加以验证。", @@ -539,7 +539,7 @@ "Search Functions": "搜索函数", "Search Models": "搜索模型", "Search Prompts": "搜索提示词", - "Search Query Generation Prompt": "搜索查询生成提示", + "Search Query Generation Prompt": "用于联网搜索关键词生成的提示词", "Search Result Count": "搜索结果数量", "Search Tools": "搜索工具", "SearchApi API Key": "SearchApi API 密钥", @@ -711,8 +711,8 @@ "Web": "网页", "Web API": "网页 API", "Web Loader Settings": "网页爬取设置", - "Web Search": "网络搜索", - "Web Search Engine": "网络搜索引擎", + "Web Search": "联网搜索", + "Web Search Engine": "联网搜索引擎", "Webhook URL": "Webhook URL", "WebUI Settings": "WebUI 设置", "WebUI will make requests to": "WebUI 将请求", From 698976add087cc6b4976d6333efa9d2383c39f22 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Sun, 8 Sep 2024 12:00:36 +0100 Subject: [PATCH 003/143] feat: add ENABLE_WEBSOCKET_SUPPORT to force socket.io to ignore websocket upgrades --- backend/open_webui/apps/socket/main.py | 10 +++++++++- backend/open_webui/config.py | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/apps/socket/main.py b/backend/open_webui/apps/socket/main.py index 5985bc524..777d877bf 100644 --- a/backend/open_webui/apps/socket/main.py +++ b/backend/open_webui/apps/socket/main.py @@ -2,9 +2,17 @@ import asyncio import socketio from open_webui.apps.webui.models.users import Users +from open_webui.config import ENABLE_WEBSOCKET_SUPPORT from open_webui.utils.utils import decode_token -sio = socketio.AsyncServer(cors_allowed_origins=[], async_mode="asgi") +sio = socketio.AsyncServer( + cors_allowed_origins=[], + async_mode="asgi", + transports=( + ["polling", "websocket"] if ENABLE_WEBSOCKET_SUPPORT.value else ["polling"] + ), + allow_upgrades=ENABLE_WEBSOCKET_SUPPORT.value, +) app = socketio.ASGIApp(sio, socketio_path="/ws/socket.io") # Dictionary to maintain the user pool diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 5ccb40d47..ac34001d6 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -810,6 +810,12 @@ ENABLE_MESSAGE_RATING = PersistentConfig( os.environ.get("ENABLE_MESSAGE_RATING", "True").lower() == "true", ) +ENABLE_WEBSOCKET_SUPPORT = PersistentConfig( + "ENABLE_WEBSOCKET_SUPPORT", + "ui.enable_websocket_support", + os.environ.get("ENABLE_WEBSOCKET_SUPPORT", "True").lower() == "true", +) + def validate_cors_origins(origins): for origin in origins: From 83a3e53d8d24d82829a89d2274b9290a6b9f8b60 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 8 Sep 2024 17:36:51 +0200 Subject: [PATCH 004/143] Add padding to compensate for iPhone nav bar --- src/app.html | 5 ++++- src/lib/components/chat/MessageInput.svelte | 2 +- .../components/chat/Settings/Advanced/AdvancedParams.svelte | 2 +- src/lib/components/layout/Sidebar.svelte | 2 +- tailwind.config.js | 3 +++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app.html b/src/app.html index 59fd7c5ed..532f2e9b5 100644 --- a/src/app.html +++ b/src/app.html @@ -4,7 +4,10 @@ - +
-
+
-
+
{$i18n.t('Seed')}
diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 168f7eaf2..e78bda96a 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -551,7 +551,7 @@
-
+
diff --git a/tailwind.config.js b/tailwind.config.js index 893cda83d..69b84725e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -30,6 +30,9 @@ export default { 'code::after': false } } + }, + padding: { + 'safe-bottom': 'env(safe-area-inset-bottom)' } } }, From 8e6ea49e0ec3eb68a1844d5b9ec12479ce00a230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Surmaczewski?= Date: Sun, 8 Sep 2024 17:52:58 +0200 Subject: [PATCH 005/143] fix: incorrect casting of top_p and frequency_penalty --- backend/open_webui/utils/payload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/payload.py b/backend/open_webui/utils/payload.py index 227cca45f..b2654cd25 100644 --- a/backend/open_webui/utils/payload.py +++ b/backend/open_webui/utils/payload.py @@ -44,9 +44,9 @@ def apply_model_params_to_body( def apply_model_params_to_body_openai(params: dict, form_data: dict) -> dict: mappings = { "temperature": float, - "top_p": int, + "top_p": float, "max_tokens": int, - "frequency_penalty": int, + "frequency_penalty": float, "seed": lambda x: x, "stop": lambda x: [bytes(s, "utf-8").decode("unicode_escape") for s in x], } From 82fbfd69a5a3e4a78975136286676831c44387d7 Mon Sep 17 00:00:00 2001 From: Andreas Fritzler Date: Sun, 8 Sep 2024 20:18:49 +0200 Subject: [PATCH 006/143] Improve `kustomization` usage Ensure that the `manifest/base` folder can be used as a standalone kustomization resource. Add a new subfolder `manifest/gpu` which uses `manifest/base` with additional GPU related patches. --- kubernetes/manifest/base/kustomization.yaml | 8 ++++++++ kubernetes/manifest/gpu/kustomization.yaml | 8 ++++++++ .../{patches => gpu}/ollama-statefulset-gpu.yaml | 0 kubernetes/manifest/kustomization.yaml | 13 ------------- 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 kubernetes/manifest/base/kustomization.yaml create mode 100644 kubernetes/manifest/gpu/kustomization.yaml rename kubernetes/manifest/{patches => gpu}/ollama-statefulset-gpu.yaml (100%) delete mode 100644 kubernetes/manifest/kustomization.yaml diff --git a/kubernetes/manifest/base/kustomization.yaml b/kubernetes/manifest/base/kustomization.yaml new file mode 100644 index 000000000..61500f87c --- /dev/null +++ b/kubernetes/manifest/base/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - open-webui.yaml + - ollama-service.yaml + - ollama-statefulset.yaml + - webui-deployment.yaml + - webui-service.yaml + - webui-ingress.yaml + - webui-pvc.yaml diff --git a/kubernetes/manifest/gpu/kustomization.yaml b/kubernetes/manifest/gpu/kustomization.yaml new file mode 100644 index 000000000..c0d39fbfa --- /dev/null +++ b/kubernetes/manifest/gpu/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../base + +patches: +- path: ollama-statefulset-gpu.yaml diff --git a/kubernetes/manifest/patches/ollama-statefulset-gpu.yaml b/kubernetes/manifest/gpu/ollama-statefulset-gpu.yaml similarity index 100% rename from kubernetes/manifest/patches/ollama-statefulset-gpu.yaml rename to kubernetes/manifest/gpu/ollama-statefulset-gpu.yaml diff --git a/kubernetes/manifest/kustomization.yaml b/kubernetes/manifest/kustomization.yaml deleted file mode 100644 index 907bff3e1..000000000 --- a/kubernetes/manifest/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -resources: -- base/open-webui.yaml -- base/ollama-service.yaml -- base/ollama-statefulset.yaml -- base/webui-deployment.yaml -- base/webui-service.yaml -- base/webui-ingress.yaml -- base/webui-pvc.yaml - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -patches: -- path: patches/ollama-statefulset-gpu.yaml From 601982f52bc1e1915ce377712df3a9084930ba5a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 9 Sep 2024 04:52:12 +0100 Subject: [PATCH 007/143] fix: lengthy chat title delete ui issue --- src/lib/components/common/ConfirmDialog.svelte | 8 ++++---- src/lib/components/layout/Sidebar.svelte | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/common/ConfirmDialog.svelte b/src/lib/components/common/ConfirmDialog.svelte index c0ba3783c..b9e0f87a4 100644 --- a/src/lib/components/common/ConfirmDialog.svelte +++ b/src/lib/components/common/ConfirmDialog.svelte @@ -49,20 +49,20 @@
{ show = false; }} >
{ e.stopPropagation(); }} > -
+
{#if title !== ''} {title} @@ -72,7 +72,7 @@
-
+
{#if message !== ''} {message} {:else} diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index e78bda96a..49068e48d 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -240,7 +240,7 @@ deleteChatHandler(deleteChat.id); }} > -
+
{$i18n.t('This will delete')} {deleteChat.title}.
From f88a86f9b071ab8af7c132bce5c0aa643b60e36a Mon Sep 17 00:00:00 2001 From: Zohaib Rauf Date: Sun, 8 Sep 2024 22:57:33 -0700 Subject: [PATCH 008/143] Fixed build error --- .../chat/MessageInput/CallOverlay.svelte | 59 ++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/MessageInput/CallOverlay.svelte b/src/lib/components/chat/MessageInput/CallOverlay.svelte index 320efa922..b16b64a46 100644 --- a/src/lib/components/chat/MessageInput/CallOverlay.svelte +++ b/src/lib/components/chat/MessageInput/CallOverlay.svelte @@ -52,11 +52,36 @@ let videoInputDevices = []; let selectedVideoInputDeviceId = null; + let speechRate = 1; + let showSpeedMenu = false; + + const speedOptions = [0.5, 1, 1.5, 2, 2.5, 3]; + + const toggleSpeedMenu = () => { + showSpeedMenu = !showSpeedMenu; + }; + + const setSpeedRate = (rate: number) => { + speechRate = rate; + showSpeedMenu = false; + updateAudioSpeed(); + }; + + const updateAudioSpeed = () => { + if (currentUtterance) { + currentUtterance.rate = speechRate; + } + const audioElement = document.getElementById('audioElement') as HTMLAudioElement; + if (audioElement) { + audioElement.playbackRate = speechRate; + } + }; + const getVideoInputDevices = async () => { const devices = await navigator.mediaDevices.enumerateDevices(); videoInputDevices = devices.filter((device) => device.kind === 'videoinput'); - if (!!navigator.mediaDevices.getDisplayMedia) { + if (navigator.mediaDevices.getDisplayMedia) { videoInputDevices = [ ...videoInputDevices, { @@ -360,6 +385,7 @@ ?.at(0) ?? undefined; currentUtterance = new SpeechSynthesisUtterance(content); + currentUtterance.rate = speechRate; if (voice) { currentUtterance.voice = voice; @@ -381,11 +407,12 @@ const playAudio = (audio) => { if ($showCallOverlay) { return new Promise((resolve) => { - const audioElement = document.getElementById('audioElement'); + const audioElement = document.getElementById('audioElement') as HTMLAudioElement; if (audioElement) { audioElement.src = audio.src; audioElement.muted = true; + audioElement.playbackRate = speechRate; audioElement .play() @@ -918,6 +945,34 @@
+
+ + {#if showSpeedMenu} +
showSpeedMenu = false} + role="menu" + tabindex="0" + > + {#each speedOptions as speed} + + {/each} +
+ {/if} +
+
-
- {/each} -
+ }, []); + + let showCitationModal = false; + let selectedCitation = null; + + + + +{#if _citations.length > 0} +
+ {#each _citations as citation, idx} +
+ +
+ {/each} +
+{/if} From d05ba042c04b8dd47cc5f16018e772da8e08fc43 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Thu, 12 Sep 2024 14:00:24 +0200 Subject: [PATCH 027/143] Make the optional AUTOMATIC1111 values nullable This commit makes the optional AUTOMATIC1111 options default to None, and if the value is removed, it resets to None. Signed-off-by: Balazs Toldi --- backend/open_webui/apps/images/main.py | 14 ++++++-------- backend/open_webui/config.py | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/backend/open_webui/apps/images/main.py b/backend/open_webui/apps/images/main.py index 773a685d9..390273a26 100644 --- a/backend/open_webui/apps/images/main.py +++ b/backend/open_webui/apps/images/main.py @@ -111,9 +111,9 @@ class OpenAIConfigForm(BaseModel): class Automatic1111ConfigForm(BaseModel): AUTOMATIC1111_BASE_URL: str AUTOMATIC1111_API_AUTH: str - AUTOMATIC1111_CFG_SCALE: float - AUTOMATIC1111_SAMPLER: str - AUTOMATIC1111_SCHEDULER: str + AUTOMATIC1111_CFG_SCALE: Optional[str] + AUTOMATIC1111_SAMPLER: Optional[str] + AUTOMATIC1111_SCHEDULER: Optional[str] class ComfyUIConfigForm(BaseModel): @@ -144,12 +144,10 @@ async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)): app.state.config.AUTOMATIC1111_API_AUTH = ( form_data.automatic1111.AUTOMATIC1111_API_AUTH ) - app.state.config.AUTOMATIC1111_CFG_SCALE = form_data.automatic1111.AUTOMATIC1111_CFG_SCALE - app.state.config.AUTOMATIC1111_SAMPLER = form_data.automatic1111.AUTOMATIC1111_SAMPLER - app.state.config.AUTOMATIC1111_SCHEDULER = ( - form_data.automatic1111.AUTOMATIC1111_SCHEDULER - ) + app.state.config.AUTOMATIC1111_CFG_SCALE = float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE) if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE != "" else None + app.state.config.AUTOMATIC1111_SAMPLER = form_data.automatic1111.AUTOMATIC1111_SAMPLER if form_data.automatic1111.AUTOMATIC1111_SAMPLER != "" else None + app.state.config.AUTOMATIC1111_SCHEDULER = form_data.automatic1111.AUTOMATIC1111_SCHEDULER if form_data.automatic1111.AUTOMATIC1111_SCHEDULER != "" else None app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/") app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index e252a0dbb..d5f9de4f3 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1270,19 +1270,33 @@ AUTOMATIC1111_API_AUTH = PersistentConfig( AUTOMATIC1111_CFG_SCALE = PersistentConfig( "AUTOMATIC1111_CFG_SCALE", "image_generation.automatic1111.cfg_scale", - float(os.getenv("AUTOMATIC1111_CFG_SCALE", 7.0)), + ( + float(os.environ.get("AUTOMATIC1111_CFG_SCALE")) + if os.environ.get("AUTOMATIC1111_CFG_SCALE") + else None + ), ) + AUTOMATIC1111_SAMPLER = PersistentConfig( "AUTOMATIC1111_SAMPLERE", "image_generation.automatic1111.sampler", - os.getenv("AUTOMATIC1111_SAMPLER", "Euler"), + ( + os.environ.get("AUTOMATIC1111_SAMPLER") + if os.environ.get("AUTOMATIC1111_SAMPLER") + else None + ) + ) AUTOMATIC1111_SCHEDULER = PersistentConfig( "AUTOMATIC1111_SCHEDULER", "image_generation.automatic1111.scheduler", - os.getenv("AUTOMATIC1111_SCHEDULER", "Automatic"), + ( + os.environ.get("AUTOMATIC1111_SCHEDULER") + if os.environ.get("AUTOMATIC1111_SCHEDULER") + else None + ) ) COMFYUI_BASE_URL = PersistentConfig( From d5b595a8422388a32cacf665f13c7a6a5e759cc7 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 12 Sep 2024 09:11:45 -0400 Subject: [PATCH 028/143] fix: ol numbering --- src/app.css | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/app.css b/src/app.css index a421d90ae..08544d0ba 100644 --- a/src/app.css +++ b/src/app.css @@ -50,21 +50,6 @@ iframe { @apply rounded-lg; } -ol > li { - counter-increment: list-number; - display: block; - margin-bottom: 0; - margin-top: 0; - min-height: 28px; -} - -.prose ol > li::before { - content: counters(list-number, '.') '.'; - padding-right: 0.5rem; - color: var(--tw-prose-counters); - font-weight: 400; -} - li p { display: inline; } From 0b30dc357cce7042aad131d55ae0bb54835019f8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 12 Sep 2024 09:13:21 -0400 Subject: [PATCH 029/143] refac: remove prints --- backend/open_webui/apps/socket/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/apps/socket/main.py b/backend/open_webui/apps/socket/main.py index d6f1a4999..e41ef8412 100644 --- a/backend/open_webui/apps/socket/main.py +++ b/backend/open_webui/apps/socket/main.py @@ -39,7 +39,7 @@ async def connect(sid, environ, auth): else: USER_POOL[user.id] = [sid] - print(f"user {user.name}({user.id}) connected with session ID {sid}") + # print(f"user {user.name}({user.id}) connected with session ID {sid}") await sio.emit("user-count", {"count": len(set(USER_POOL))}) await sio.emit("usage", {"models": get_models_in_use()}) @@ -47,7 +47,7 @@ async def connect(sid, environ, auth): @sio.on("user-join") async def user_join(sid, data): - print("user-join", sid, data) + # print("user-join", sid, data) auth = data["auth"] if "auth" in data else None if not auth or "token" not in auth: @@ -67,7 +67,7 @@ async def user_join(sid, data): else: USER_POOL[user.id] = [sid] - print(f"user {user.name}({user.id}) connected with session ID {sid}") + # print(f"user {user.name}({user.id}) connected with session ID {sid}") await sio.emit("user-count", {"count": len(set(USER_POOL))}) @@ -116,7 +116,7 @@ async def remove_after_timeout(sid, model_id): try: await asyncio.sleep(TIMEOUT_DURATION) if model_id in USAGE_POOL: - print(USAGE_POOL[model_id]["sids"]) + # print(USAGE_POOL[model_id]["sids"]) USAGE_POOL[model_id]["sids"].remove(sid) USAGE_POOL[model_id]["sids"] = list(set(USAGE_POOL[model_id]["sids"])) @@ -143,7 +143,8 @@ async def disconnect(sid): await sio.emit("user-count", {"count": len(USER_POOL)}) else: - print(f"Unknown session ID {sid} disconnected") + pass + # print(f"Unknown session ID {sid} disconnected") def get_event_emitter(request_info): From 62f1933e3c423d11f6a580bceb65e648cab06e72 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 12 Sep 2024 09:18:20 -0400 Subject: [PATCH 030/143] refac: audio input (audio/ogg support) --- backend/open_webui/apps/audio/main.py | 2 +- src/lib/components/chat/MessageInput.svelte | 31 ++++++++++--------- src/lib/components/workspace/Documents.svelte | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/backend/open_webui/apps/audio/main.py b/backend/open_webui/apps/audio/main.py index 345e0390a..8f643ffd3 100644 --- a/backend/open_webui/apps/audio/main.py +++ b/backend/open_webui/apps/audio/main.py @@ -309,7 +309,7 @@ def transcribe( ): log.info(f"file.content_type: {file.content_type}") - if file.content_type not in ["audio/mpeg", "audio/wav"]: + if file.content_type not in ["audio/mpeg", "audio/wav", "audio/ogg"]: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.FILE_NOT_SUPPORTED, diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 79bd4531d..ea4400bbc 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -93,20 +93,6 @@ const uploadFileHandler = async (file) => { console.log(file); - // Check if the file is an audio file and transcribe/convert it to text file - if (['audio/mpeg', 'audio/wav'].includes(file['type'])) { - const res = await transcribeAudio(localStorage.token, file).catch((error) => { - toast.error(error); - return null; - }); - - if (res) { - console.log(res); - const blob = new Blob([res.text], { type: 'text/plain' }); - file = blobToFile(blob, `${file.name}.txt`); - } - } - const fileItem = { type: 'file', file: '', @@ -120,6 +106,23 @@ }; files = [...files, fileItem]; + // Check if the file is an audio file and transcribe/convert it to text file + if (['audio/mpeg', 'audio/wav', 'audio/ogg'].includes(file['type'])) { + const res = await transcribeAudio(localStorage.token, file).catch((error) => { + toast.error(error); + return null; + }); + + if (res) { + console.log(res); + const blob = new Blob([res.text], { type: 'text/plain' }); + file = blobToFile(blob, `${file.name}.txt`); + + fileItem.name = file.name; + fileItem.size = file.size; + } + } + try { const uploadedFile = await uploadFile(localStorage.token, file); diff --git a/src/lib/components/workspace/Documents.svelte b/src/lib/components/workspace/Documents.svelte index db101dd0a..f1e77bddd 100644 --- a/src/lib/components/workspace/Documents.svelte +++ b/src/lib/components/workspace/Documents.svelte @@ -55,7 +55,7 @@ const uploadDoc = async (file, tags?: object) => { console.log(file); // Check if the file is an audio file and transcribe/convert it to text file - if (['audio/mpeg', 'audio/wav'].includes(file['type'])) { + if (['audio/mpeg', 'audio/wav', 'audio/ogg'].includes(file['type'])) { const transcribeRes = await transcribeAudio(localStorage.token, file).catch((error) => { toast.error(error); return null; From 53f03f65561f74927382b115d5eee5ed826015e7 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:34:52 +0200 Subject: [PATCH 031/143] fix: log exception when issues of collection querying --- backend/open_webui/apps/rag/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 2bf8a02e4..c179f47c0 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -150,8 +150,8 @@ def query_collection( embedding_function=embedding_function, ) results.append(result) - except Exception: - pass + except Exception as e: + log.exception(f"Error when querying the collection: {e}") else: pass @@ -178,8 +178,11 @@ def query_collection_with_hybrid_search( r=r, ) results.append(result) - except Exception: - pass + except Exception as e: + log.exception( + "Error when querying the collection with " + f"hybrid_search: {e}" + ) return merge_and_sort_query_results(results, k=k, reverse=True) From 143ac08c359ee5b96ed35dbd7330ee5a941b7c18 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 12 Sep 2024 10:56:16 -0400 Subject: [PATCH 032/143] refac --- src/lib/components/chat/MessageInput/Suggestions.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/MessageInput/Suggestions.svelte b/src/lib/components/chat/MessageInput/Suggestions.svelte index 4e660c791..8c549b67b 100644 --- a/src/lib/components/chat/MessageInput/Suggestions.svelte +++ b/src/lib/components/chat/MessageInput/Suggestions.svelte @@ -9,7 +9,7 @@ let prompts = []; - $: prompts = suggestionPrompts + $: prompts = (suggestionPrompts ?? []) .reduce((acc, current) => [...acc, ...[current]], []) .sort(() => Math.random() - 0.5); // suggestionPrompts.length <= 4 From ed2a1e7db960fa6aa4c1c298272164c6f48f5bc0 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:58:26 +0200 Subject: [PATCH 033/143] enh: use non hybrid search as fallback if hybrid search failed --- backend/open_webui/apps/rag/utils.py | 30 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index c179f47c0..dd4cdd007 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -167,6 +167,7 @@ def query_collection_with_hybrid_search( r: float, ): results = [] + failed = 0 for collection_name in collection_names: try: result = query_doc_with_hybrid_search( @@ -183,6 +184,10 @@ def query_collection_with_hybrid_search( "Error when querying the collection with " f"hybrid_search: {e}" ) + failed += 1 + if failed == len(collection_names): + raise Exception("Hybrid search failed for all collections. Using " + "Non hybrid search as fallback.") return merge_and_sort_query_results(results, k=k, reverse=True) @@ -265,19 +270,25 @@ def get_rag_context( continue try: + context = None if file["type"] == "text": context = file["content"] else: if hybrid_search: - context = query_collection_with_hybrid_search( - collection_names=collection_names, - query=query, - embedding_function=embedding_function, - k=k, - reranking_function=reranking_function, - r=r, - ) - else: + try: + context = query_collection_with_hybrid_search( + collection_names=collection_names, + query=query, + embedding_function=embedding_function, + k=k, + reranking_function=reranking_function, + r=r, + ) + except Exception as e: + log.debug("Error when using hybrid search, using" + " non hybrid search as fallback.") + + if (not hybrid_search) or (context is None): context = query_collection( collection_names=collection_names, query=query, @@ -286,7 +297,6 @@ def get_rag_context( ) except Exception as e: log.exception(e) - context = None if context: relevant_contexts.append({**context, "source": file}) From 209e246e6f5fce408421eb30001c1886885aee5a Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:31:49 +0200 Subject: [PATCH 034/143] fix: much improved RAG template --- backend/open_webui/config.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 5ccb40d47..c87256a08 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1085,19 +1085,25 @@ CHUNK_OVERLAP = PersistentConfig( int(os.environ.get("CHUNK_OVERLAP", "100")), ) -DEFAULT_RAG_TEMPLATE = """Use the following context as your learned knowledge, inside XML tags. +DEFAULT_RAG_TEMPLATE = """You are given a user query, some textual context and rules, all inside xml tags. You have to answer the query based on the context while respecting the rules. + - [context] +[context] -When answer to user: -- If you don't know, just say that you don't know. -- If you don't know when you are not sure, ask for clarification. -Avoid mentioning that you obtained the information from the context. -And answer according to the language of the user's question. + +- If you don't know, just say so. +- If you are not sure, ask for clarification. +- Answer in the same language as the user query. +- If the context appears unreadable or of poor quality, tell the user then answer as best as you can. +- If the answer is not in the context but you think you know the answer, explain that to the user then answer with your own knowledge. +- Answer directly and without using xml tags. + -Given the context information, answer the query. -Query: [query]""" + +[query] + +""" RAG_TEMPLATE = PersistentConfig( "RAG_TEMPLATE", From adf26789b8c1c9c256f22aef98f64449d8f684a5 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:19:24 +0200 Subject: [PATCH 035/143] logs: crash if rag_template would be wrong --- backend/open_webui/apps/rag/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index dd4cdd007..5bddf0a96 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -192,6 +192,11 @@ def query_collection_with_hybrid_search( def rag_template(template: str, context: str, query: str): + count = template.count("[context]") + assert count == 1, ( + f"RAG template contains an unexpected number of '[context]' : {count}" + ) + assert "[context]" in template, "RAG template does not contain '[context]'" template = template.replace("[context]", context) template = template.replace("[query]", query) return template From 9661fee55428b81c3f65bc2863efbcd70c7e403a Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:19:40 +0200 Subject: [PATCH 036/143] fix: handle case where [query] happens in the RAG context --- backend/open_webui/apps/rag/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 5bddf0a96..41fc4e2d4 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -1,5 +1,6 @@ import logging import os +import uuid from typing import Optional, Union import requests @@ -197,8 +198,15 @@ def rag_template(template: str, context: str, query: str): f"RAG template contains an unexpected number of '[context]' : {count}" ) assert "[context]" in template, "RAG template does not contain '[context]'" - template = template.replace("[context]", context) - template = template.replace("[query]", query) + + if "[query]" in context: + query_placeholder = str(uuid.uuid4()) + template = template.replace("[QUERY]", query_placeholder) + template = template.replace("[context]", context) + template = template.replace(query_placeholder, query) + else: + template = template.replace("[context]", context) + template = template.replace("[query]", query) return template From b4ad64586aceeae45dd5cc4178f43b4b6c00fb77 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:36:37 +0200 Subject: [PATCH 037/143] fix: add check that the context for RAG is not empty if the threshold is 0 --- backend/open_webui/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 8914cb491..bf586e56d 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -588,6 +588,11 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): prompt = get_last_user_message(body["messages"]) if prompt is None: raise Exception("No user message found") + if rag_app.state.config.RELEVANCE_THRESHOLD == 0: + assert context_string.strip(), ( + "With a 0 relevancy threshold for RAG, the context cannot " + "be empty" + ) # Workaround for Ollama 2.0+ system prompt issue # TODO: replace with add_or_update_system_message if model["owned_by"] == "ollama": From e872f5dc78e5585b205e378bab87b26de5ff59e2 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:04:41 +0200 Subject: [PATCH 038/143] log: added a debug log if detecting a potential prompt injection attack --- backend/open_webui/apps/rag/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 41fc4e2d4..29b12d0b0 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -198,6 +198,12 @@ def rag_template(template: str, context: str, query: str): f"RAG template contains an unexpected number of '[context]' : {count}" ) assert "[context]" in template, "RAG template does not contain '[context]'" + if "" in context and "" in context: + log.debug( + "WARNING: Potential prompt injection attack: the RAG " + "context contains '' and ''. This might be " + "nothing, or the user might be trying to hack something." + ) if "[query]" in context: query_placeholder = str(uuid.uuid4()) From 65d5545cf0cd85c1b4a5e55266289b42879c4673 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:50:18 +0200 Subject: [PATCH 039/143] added a few type hints --- backend/open_webui/apps/rag/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 29b12d0b0..9da08e28a 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -48,7 +48,7 @@ def query_doc_with_hybrid_search( k: int, reranking_function, r: float, -): +) -> dict: try: collection = CHROMA_CLIENT.get_collection(name=collection_name) documents = collection.get() # get all documents @@ -93,7 +93,7 @@ def query_doc_with_hybrid_search( raise e -def merge_and_sort_query_results(query_results, k, reverse=False): +def merge_and_sort_query_results(query_results: list[dict], k: int, reverse: bool = False) -> list[dict]: # Initialize lists to store combined data combined_distances = [] combined_documents = [] @@ -139,7 +139,7 @@ def query_collection( query: str, embedding_function, k: int, -): +) -> dict: results = [] for collection_name in collection_names: if collection_name: @@ -166,7 +166,7 @@ def query_collection_with_hybrid_search( k: int, reranking_function, r: float, -): +) -> dict: results = [] failed = 0 for collection_name in collection_names: From ca9874757f379799d076c4300c9ee876afa3a0ab Mon Sep 17 00:00:00 2001 From: Peter De-Ath Date: Thu, 12 Sep 2024 19:59:29 +0100 Subject: [PATCH 040/143] fix: change metadata to metadatas --- backend/open_webui/apps/rag/vector/dbs/chroma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/rag/vector/dbs/chroma.py b/backend/open_webui/apps/rag/vector/dbs/chroma.py index 693b41f23..9115fb9f5 100644 --- a/backend/open_webui/apps/rag/vector/dbs/chroma.py +++ b/backend/open_webui/apps/rag/vector/dbs/chroma.py @@ -96,10 +96,10 @@ class ChromaClient: ids = [item["id"] for item in items] documents = [item["text"] for item in items] embeddings = [item["vector"] for item in items] - metadata = [item["metadata"] for item in items] + metadatas = [item["metadata"] for item in items] collection.upsert( - ids=ids, documents=documents, embeddings=embeddings, metadata=metadata + ids=ids, documents=documents, embeddings=embeddings, metadatas=metadatas ) def delete(self, collection_name: str, ids: list[str]): From 47e9c12fc2d9dd08f1824a84222e99e7c2d22303 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 00:41:20 -0400 Subject: [PATCH 041/143] refac --- .../open_webui/apps/webui/routers/models.py | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/backend/open_webui/apps/webui/routers/models.py b/backend/open_webui/apps/webui/routers/models.py index a99c65d76..a5cb2395e 100644 --- a/backend/open_webui/apps/webui/routers/models.py +++ b/backend/open_webui/apps/webui/routers/models.py @@ -18,8 +18,18 @@ router = APIRouter() @router.get("/", response_model=list[ModelResponse]) -async def get_models(user=Depends(get_verified_user)): - return Models.get_all_models() +async def get_models(id: Optional[str] = None, user=Depends(get_verified_user)): + if id: + model = Models.get_model_by_id(id) + if model: + return [model] + else: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail=ERROR_MESSAGES.NOT_FOUND, + ) + else: + return Models.get_all_models() ############################ @@ -50,24 +60,6 @@ async def add_new_model( ) -############################ -# GetModelById -############################ - - -@router.get("/", response_model=Optional[ModelModel]) -async def get_model_by_id(id: str, user=Depends(get_verified_user)): - model = Models.get_model_by_id(id) - - if model: - return model - else: - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail=ERROR_MESSAGES.NOT_FOUND, - ) - - ############################ # UpdateModelById ############################ From bebc0d207303538bce03b1c7c451ec8641480db2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 00:48:54 -0400 Subject: [PATCH 042/143] chore: format --- backend/open_webui/apps/rag/utils.py | 25 ++++++++----- .../components/admin/Settings/Images.svelte | 37 ++++++++++++++++++- src/lib/i18n/locales/ar-BH/translation.json | 6 +++ src/lib/i18n/locales/bg-BG/translation.json | 6 +++ src/lib/i18n/locales/bn-BD/translation.json | 6 +++ src/lib/i18n/locales/ca-ES/translation.json | 6 +++ src/lib/i18n/locales/ceb-PH/translation.json | 6 +++ src/lib/i18n/locales/de-DE/translation.json | 6 +++ src/lib/i18n/locales/dg-DG/translation.json | 6 +++ src/lib/i18n/locales/en-GB/translation.json | 6 +++ src/lib/i18n/locales/es-ES/translation.json | 6 +++ src/lib/i18n/locales/fa-IR/translation.json | 6 +++ src/lib/i18n/locales/fi-FI/translation.json | 6 +++ src/lib/i18n/locales/fr-CA/translation.json | 6 +++ src/lib/i18n/locales/fr-FR/translation.json | 6 +++ src/lib/i18n/locales/he-IL/translation.json | 6 +++ src/lib/i18n/locales/hi-IN/translation.json | 6 +++ src/lib/i18n/locales/hr-HR/translation.json | 6 +++ src/lib/i18n/locales/id-ID/translation.json | 6 +++ src/lib/i18n/locales/it-IT/translation.json | 6 +++ src/lib/i18n/locales/ja-JP/translation.json | 6 +++ src/lib/i18n/locales/ka-GE/translation.json | 6 +++ src/lib/i18n/locales/ko-KR/translation.json | 6 +++ src/lib/i18n/locales/lt-LT/translation.json | 6 +++ src/lib/i18n/locales/ms-MY/translation.json | 6 +++ src/lib/i18n/locales/nb-NO/translation.json | 6 +++ src/lib/i18n/locales/nl-NL/translation.json | 6 +++ src/lib/i18n/locales/pa-IN/translation.json | 6 +++ src/lib/i18n/locales/pl-PL/translation.json | 6 +++ src/lib/i18n/locales/pt-BR/translation.json | 6 +++ src/lib/i18n/locales/pt-PT/translation.json | 6 +++ src/lib/i18n/locales/ro-RO/translation.json | 6 +++ src/lib/i18n/locales/ru-RU/translation.json | 6 +++ src/lib/i18n/locales/sr-RS/translation.json | 6 +++ src/lib/i18n/locales/sv-SE/translation.json | 6 +++ src/lib/i18n/locales/th-TH/translation.json | 6 +++ src/lib/i18n/locales/tk-TW/translation.json | 6 +++ src/lib/i18n/locales/tr-TR/translation.json | 6 +++ src/lib/i18n/locales/uk-UA/translation.json | 6 +++ src/lib/i18n/locales/vi-VN/translation.json | 6 +++ src/lib/i18n/locales/zh-CN/translation.json | 6 +++ src/lib/i18n/locales/zh-TW/translation.json | 6 +++ 42 files changed, 290 insertions(+), 12 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index e64b71297..22f34c6a9 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -135,7 +135,9 @@ def query_doc_with_hybrid_search( raise e -def merge_and_sort_query_results(query_results: list[dict], k: int, reverse: bool = False) -> list[dict]: +def merge_and_sort_query_results( + query_results: list[dict], k: int, reverse: bool = False +) -> list[dict]: # Initialize lists to store combined data combined_distances = [] combined_documents = [] @@ -224,21 +226,22 @@ def query_collection_with_hybrid_search( results.append(result) except Exception as e: log.exception( - "Error when querying the collection with " - f"hybrid_search: {e}" + "Error when querying the collection with " f"hybrid_search: {e}" ) failed += 1 if failed == len(collection_names): - raise Exception("Hybrid search failed for all collections. Using " - "Non hybrid search as fallback.") + raise Exception( + "Hybrid search failed for all collections. Using " + "Non hybrid search as fallback." + ) return merge_and_sort_query_results(results, k=k, reverse=True) def rag_template(template: str, context: str, query: str): count = template.count("[context]") - assert count == 1, ( - f"RAG template contains an unexpected number of '[context]' : {count}" - ) + assert ( + count == 1 + ), f"RAG template contains an unexpected number of '[context]' : {count}" assert "[context]" in template, "RAG template does not contain '[context]'" if "" in context and "" in context: log.debug( @@ -346,8 +349,10 @@ def get_rag_context( r=r, ) except Exception as e: - log.debug("Error when using hybrid search, using" - " non hybrid search as fallback.") + log.debug( + "Error when using hybrid search, using" + " non hybrid search as fallback." + ) if (not hybrid_search) or (context is None): context = query_collection( diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index 55afda25b..09b3c77d0 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -27,9 +27,42 @@ let models = null; - let samplers = ["DPM++ 2M", "DPM++ SDE", "DPM++ 2M SDE", "DPM++ 2M SDE Heun", "DPM++ 2S a", "DPM++ 3M SDE", "Euler a", "Euler", "LMS", "Heun", "DPM2", "DPM2 a", "DPM fast", "DPM adaptive", "Restart", "DDIM", "DDIM CFG++", "PLMS", "UniPC"]; + let samplers = [ + 'DPM++ 2M', + 'DPM++ SDE', + 'DPM++ 2M SDE', + 'DPM++ 2M SDE Heun', + 'DPM++ 2S a', + 'DPM++ 3M SDE', + 'Euler a', + 'Euler', + 'LMS', + 'Heun', + 'DPM2', + 'DPM2 a', + 'DPM fast', + 'DPM adaptive', + 'Restart', + 'DDIM', + 'DDIM CFG++', + 'PLMS', + 'UniPC' + ]; - let schedulers = ["Automatic", "Uniform", "Karras", "Exponential", "Polyexponential", "SGM Uniform", "KL Optimal", "Align Your Steps", "Simple", "Normal", "DDIM", "Beta"]; + let schedulers = [ + 'Automatic', + 'Uniform', + 'Karras', + 'Exponential', + 'Polyexponential', + 'SGM Uniform', + 'KL Optimal', + 'Align Your Steps', + 'Simple', + 'Normal', + 'DDIM', + 'Beta' + ]; let requiredWorkflowNodes = [ { diff --git a/src/lib/i18n/locales/ar-BH/translation.json b/src/lib/i18n/locales/ar-BH/translation.json index 66704c1b4..129ec24af 100644 --- a/src/lib/i18n/locales/ar-BH/translation.json +++ b/src/lib/i18n/locales/ar-BH/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "ادخل معلومات عنك تريد أن يتذكرها الموديل", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "أدخل مفتاح واجهة برمجة تطبيقات البحث الشجاع", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "أدخل الChunk Overlap", "Enter Chunk Size": "أدخل Chunk الحجم", "Enter Github Raw URL": "أدخل عنوان URL ل Github Raw", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "(e.g. {{modelTag}}) أدخل الموديل تاق", "Enter Number of Steps (e.g. 50)": "(e.g. 50) أدخل عدد الخطوات", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "أدخل النتيجة", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -578,10 +581,13 @@ "Serpstack API Key": "مفتاح واجهة برمجة تطبيقات Serpstack", "Server connection verified": "تم التحقق من اتصال الخادم", "Set as default": "الافتراضي", + "Set CFG Scale": "", "Set Default Model": "تفعيد الموديل الافتراضي", "Set embedding model (e.g. {{model}})": "ضبط نموذج المتجهات (على سبيل المثال: {{model}})", "Set Image Size": "حجم الصورة", "Set reranking model (e.g. {{model}})": "ضبط نموذج إعادة الترتيب (على سبيل المثال: {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "ضبط الخطوات", "Set Task Model": "تعيين نموذج المهمة", "Set Voice": "ضبط الصوت", diff --git a/src/lib/i18n/locales/bg-BG/translation.json b/src/lib/i18n/locales/bg-BG/translation.json index ec39561ea..e8288fd98 100644 --- a/src/lib/i18n/locales/bg-BG/translation.json +++ b/src/lib/i18n/locales/bg-BG/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Въведете подробности за себе си, за да се herinnerат вашите LLMs", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Въведете Brave Search API ключ", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Въведете Chunk Overlap", "Enter Chunk Size": "Въведете Chunk Size", "Enter Github Raw URL": "Въведете URL адреса на Github Raw", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Въведете таг на модел (напр. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Въведете брой стъпки (напр. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Въведете оценка", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API ключ", "Server connection verified": "Server connection verified", "Set as default": "Задай по подразбиране", + "Set CFG Scale": "", "Set Default Model": "Задай Модел По Подразбиране", "Set embedding model (e.g. {{model}})": "Задай embedding model (e.g. {{model}})", "Set Image Size": "Задай Размер на Изображението", "Set reranking model (e.g. {{model}})": "Задай reranking model (e.g. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Задай Стъпки", "Set Task Model": "Задаване на модел на задача", "Set Voice": "Задай Глас", diff --git a/src/lib/i18n/locales/bn-BD/translation.json b/src/lib/i18n/locales/bn-BD/translation.json index 6a14720e2..1a072838b 100644 --- a/src/lib/i18n/locales/bn-BD/translation.json +++ b/src/lib/i18n/locales/bn-BD/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "আপনার এলএলএমগুলি স্মরণ করার জন্য নিজের সম্পর্কে একটি বিশদ লিখুন", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "সাহসী অনুসন্ধান API কী লিখুন", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "চাঙ্ক ওভারল্যাপ লিখুন", "Enter Chunk Size": "চাংক সাইজ লিখুন", "Enter Github Raw URL": "গিটহাব কাঁচা URL লিখুন", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "মডেল ট্যাগ লিখুন (e.g. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "ধাপের সংখ্যা দিন (যেমন: 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "স্কোর দিন", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API Key", "Server connection verified": "সার্ভার কানেকশন যাচাই করা হয়েছে", "Set as default": "ডিফল্ট হিসেবে নির্ধারণ করুন", + "Set CFG Scale": "", "Set Default Model": "ডিফল্ট মডেল নির্ধারণ করুন", "Set embedding model (e.g. {{model}})": "ইমেম্বিং মডেল নির্ধারণ করুন (উদাহরণ {{model}})", "Set Image Size": "ছবির সাইজ নির্ধারণ করুন", "Set reranking model (e.g. {{model}})": "রি-র্যাংকিং মডেল নির্ধারণ করুন (উদাহরণ {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "পরবর্তী ধাপসমূহ", "Set Task Model": "টাস্ক মডেল সেট করুন", "Set Voice": "কন্ঠস্বর নির্ধারণ করুন", diff --git a/src/lib/i18n/locales/ca-ES/translation.json b/src/lib/i18n/locales/ca-ES/translation.json index 3ef6a40b4..2726ded8a 100644 --- a/src/lib/i18n/locales/ca-ES/translation.json +++ b/src/lib/i18n/locales/ca-ES/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Introdueix un detall sobre tu què els teus models de llenguatge puguin recordar", "Enter api auth string (e.g. username:password)": "Entra la cadena d'autenticació api (p. ex. nom d'usuari:contrasenya)", "Enter Brave Search API Key": "Introdueix la clau API de Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Introdueix la mida de solapament de blocs", "Enter Chunk Size": "Introdueix la mida del bloc", "Enter Github Raw URL": "Introdueix l'URL en brut de Github", @@ -248,6 +249,8 @@ "Enter Model ID": "Introdueix l'identificador del model", "Enter model tag (e.g. {{modelTag}})": "Introdueix l'etiqueta del model (p. ex. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Introdueix el nombre de passos (p. ex. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Introdueix la puntuació", "Enter SearchApi API Key": "Introdueix la clau API SearchApi", "Enter SearchApi Engine": "Introdueix el motor SearchApi", @@ -575,10 +578,13 @@ "Serpstack API Key": "Clau API de Serpstack", "Server connection verified": "Connexió al servidor verificada", "Set as default": "Establir com a predeterminat", + "Set CFG Scale": "", "Set Default Model": "Establir el model predeterminat", "Set embedding model (e.g. {{model}})": "Establir el model d'incrustació (p.ex. {{model}})", "Set Image Size": "Establir la mida de la image", "Set reranking model (e.g. {{model}})": "Establir el model de reavaluació (p.ex. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Establir el nombre de passos", "Set Task Model": "Establir el model de tasca", "Set Voice": "Establir la veu", diff --git a/src/lib/i18n/locales/ceb-PH/translation.json b/src/lib/i18n/locales/ceb-PH/translation.json index 346633225..887a5ed3f 100644 --- a/src/lib/i18n/locales/ceb-PH/translation.json +++ b/src/lib/i18n/locales/ceb-PH/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Pagsulod sa block overlap", "Enter Chunk Size": "Isulod ang block size", "Enter Github Raw URL": "", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Pagsulod sa template tag (e.g. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Pagsulod sa gidaghanon sa mga lakang (e.g. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "", "Server connection verified": "Gipamatud-an nga koneksyon sa server", "Set as default": "Define pinaagi sa default", + "Set CFG Scale": "", "Set Default Model": "Ibutang ang default template", "Set embedding model (e.g. {{model}})": "", "Set Image Size": "Ibutang ang gidak-on sa hulagway", "Set reranking model (e.g. {{model}})": "", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Ipasabot ang mga lakang", "Set Task Model": "", "Set Voice": "Ibutang ang tingog", diff --git a/src/lib/i18n/locales/de-DE/translation.json b/src/lib/i18n/locales/de-DE/translation.json index d25631aa4..8a0c99ecc 100644 --- a/src/lib/i18n/locales/de-DE/translation.json +++ b/src/lib/i18n/locales/de-DE/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Geben Sie ein Detail über sich selbst ein, das Ihre Sprachmodelle (LLMs) sich merken sollen", "Enter api auth string (e.g. username:password)": "Geben Sie die API-Authentifizierungszeichenfolge ein (z. B. Benutzername:Passwort)", "Enter Brave Search API Key": "Geben Sie den Brave Search API-Schlüssel ein", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Geben Sie die Blocküberlappung ein", "Enter Chunk Size": "Geben Sie die Blockgröße ein", "Enter Github Raw URL": "Geben Sie die Github Raw-URL ein", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Gebn Sie den Model-Tag ein", "Enter Number of Steps (e.g. 50)": "Geben Sie die Anzahl an Schritten ein (z. B. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Punktzahl eingeben", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack-API-Schlüssel", "Server connection verified": "Serververbindung überprüft", "Set as default": "Als Standard festlegen", + "Set CFG Scale": "", "Set Default Model": "Standardmodell festlegen", "Set embedding model (e.g. {{model}})": "Einbettungsmodell festlegen (z. B. {{model}})", "Set Image Size": "Bildgröße festlegen", "Set reranking model (e.g. {{model}})": "Rerankingmodell festlegen (z. B. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Schrittgröße festlegen", "Set Task Model": "Aufgabenmodell festlegen", "Set Voice": "Stimme festlegen", diff --git a/src/lib/i18n/locales/dg-DG/translation.json b/src/lib/i18n/locales/dg-DG/translation.json index 2fb5bac78..69ffc9b73 100644 --- a/src/lib/i18n/locales/dg-DG/translation.json +++ b/src/lib/i18n/locales/dg-DG/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Enter Overlap of Chunks", "Enter Chunk Size": "Enter Size of Chunk", "Enter Github Raw URL": "", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Enter model doge tag (e.g. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Enter Number of Steps (e.g. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -576,10 +579,13 @@ "Serpstack API Key": "", "Server connection verified": "Server connection verified much secure", "Set as default": "Set as default very default", + "Set CFG Scale": "", "Set Default Model": "Set Default Model much model", "Set embedding model (e.g. {{model}})": "", "Set Image Size": "Set Image Size very size", "Set reranking model (e.g. {{model}})": "", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Set Steps so many steps", "Set Task Model": "", "Set Voice": "Set Voice so speak", diff --git a/src/lib/i18n/locales/en-GB/translation.json b/src/lib/i18n/locales/en-GB/translation.json index ea56eb344..cbfa7e34a 100644 --- a/src/lib/i18n/locales/en-GB/translation.json +++ b/src/lib/i18n/locales/en-GB/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "", "Enter Chunk Size": "", "Enter Github Raw URL": "", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "", "Enter Number of Steps (e.g. 50)": "", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "", "Server connection verified": "", "Set as default": "", + "Set CFG Scale": "", "Set Default Model": "", "Set embedding model (e.g. {{model}})": "", "Set Image Size": "", "Set reranking model (e.g. {{model}})": "", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "", "Set Task Model": "", "Set Voice": "", diff --git a/src/lib/i18n/locales/es-ES/translation.json b/src/lib/i18n/locales/es-ES/translation.json index c0baca582..c15351435 100644 --- a/src/lib/i18n/locales/es-ES/translation.json +++ b/src/lib/i18n/locales/es-ES/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Ingrese un detalle sobre usted para que sus LLMs recuerden", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Ingresa la clave de API de Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Ingresar superposición de fragmentos", "Enter Chunk Size": "Ingrese el tamaño del fragmento", "Enter Github Raw URL": "Ingresa la URL sin procesar de Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Ingrese la etiqueta del modelo (p.ej. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Ingrese el número de pasos (p.ej., 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Ingrese la puntuación", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Clave API de Serpstack", "Server connection verified": "Conexión del servidor verificada", "Set as default": "Establecer por defecto", + "Set CFG Scale": "", "Set Default Model": "Establecer modelo predeterminado", "Set embedding model (e.g. {{model}})": "Establecer modelo de embedding (ej. {{model}})", "Set Image Size": "Establecer tamaño de imagen", "Set reranking model (e.g. {{model}})": "Establecer modelo de reranking (ej. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Establecer Pasos", "Set Task Model": "Establecer modelo de tarea", "Set Voice": "Establecer la voz", diff --git a/src/lib/i18n/locales/fa-IR/translation.json b/src/lib/i18n/locales/fa-IR/translation.json index f6f668f2d..09a5a5901 100644 --- a/src/lib/i18n/locales/fa-IR/translation.json +++ b/src/lib/i18n/locales/fa-IR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "برای ذخیره سازی اطلاعات خود، یک توضیح کوتاه درباره خود را وارد کنید", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "کلید API جستجوی شجاع را وارد کنید", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "مقدار Chunk Overlap را وارد کنید", "Enter Chunk Size": "مقدار Chunk Size را وارد کنید", "Enter Github Raw URL": "ادرس Github Raw را وارد کنید", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "تگ مدل را وارد کنید (مثلا {{modelTag}})", "Enter Number of Steps (e.g. 50)": "تعداد گام ها را وارد کنید (مثال: 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "امتیاز را وارد کنید", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "کلید API Serpstack", "Server connection verified": "اتصال سرور تأیید شد", "Set as default": "تنظیم به عنوان پیشفرض", + "Set CFG Scale": "", "Set Default Model": "تنظیم مدل پیش فرض", "Set embedding model (e.g. {{model}})": "تنظیم مدل پیچشی (برای مثال {{model}})", "Set Image Size": "تنظیم اندازه تصویر", "Set reranking model (e.g. {{model}})": "تنظیم مدل ری\u200cراینگ (برای مثال {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "تنظیم گام\u200cها", "Set Task Model": "تنظیم مدل تکلیف", "Set Voice": "تنظیم صدا", diff --git a/src/lib/i18n/locales/fi-FI/translation.json b/src/lib/i18n/locales/fi-FI/translation.json index 1074012d4..977465411 100644 --- a/src/lib/i18n/locales/fi-FI/translation.json +++ b/src/lib/i18n/locales/fi-FI/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Kirjoita tieto itseestäsi LLM:ien muistamiseksi", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Anna Brave Search API -avain", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Syötä osien päällekkäisyys", "Enter Chunk Size": "Syötä osien koko", "Enter Github Raw URL": "Kirjoita Github Raw URL-osoite", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Syötä mallitagi (esim. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Syötä askelien määrä (esim. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Syötä pisteet", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API -avain", "Server connection verified": "Palvelinyhteys varmennettu", "Set as default": "Aseta oletukseksi", + "Set CFG Scale": "", "Set Default Model": "Aseta oletusmalli", "Set embedding model (e.g. {{model}})": "Aseta upotusmalli (esim. {{model}})", "Set Image Size": "Aseta kuvan koko", "Set reranking model (e.g. {{model}})": "Aseta uudelleenpisteytysmalli (esim. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Aseta askelmäärä", "Set Task Model": "Aseta tehtävämalli", "Set Voice": "Aseta puheääni", diff --git a/src/lib/i18n/locales/fr-CA/translation.json b/src/lib/i18n/locales/fr-CA/translation.json index 65bc829a0..d74d96649 100644 --- a/src/lib/i18n/locales/fr-CA/translation.json +++ b/src/lib/i18n/locales/fr-CA/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Saisissez un détail sur vous-même que vos LLMs pourront se rappeler", "Enter api auth string (e.g. username:password)": "Entrez la chaîne d'authentification de l'API (par ex. nom d'utilisateur:mot de passe)", "Enter Brave Search API Key": "Entrez la clé API Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Entrez le chevauchement de chunk", "Enter Chunk Size": "Entrez la taille de bloc", "Enter Github Raw URL": "Entrez l'URL brute de GitHub", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Entrez l'étiquette du modèle (par ex. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Entrez le nombre de pas (par ex. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Entrez votre score", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Clé API Serpstack", "Server connection verified": "Connexion au serveur vérifiée", "Set as default": "Définir comme valeur par défaut", + "Set CFG Scale": "", "Set Default Model": "Définir le modèle par défaut", "Set embedding model (e.g. {{model}})": "Définir le modèle d'encodage (par ex. {{model}})", "Set Image Size": "Définir la taille de l'image", "Set reranking model (e.g. {{model}})": "Définir le modèle de reclassement (par ex. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Définir les étapes", "Set Task Model": "Définir le modèle de tâche", "Set Voice": "Définir la voix", diff --git a/src/lib/i18n/locales/fr-FR/translation.json b/src/lib/i18n/locales/fr-FR/translation.json index c7479a5b5..d3cecbf7b 100644 --- a/src/lib/i18n/locales/fr-FR/translation.json +++ b/src/lib/i18n/locales/fr-FR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Saisissez un détail sur vous-même que vos LLMs pourront se rappeler", "Enter api auth string (e.g. username:password)": "Entrez la chaîne d'authentification de l'API (par ex. nom d'utilisateur:mot de passe)", "Enter Brave Search API Key": "Entrez la clé API Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Entrez le chevauchement des chunks", "Enter Chunk Size": "Entrez la taille des chunks", "Enter Github Raw URL": "Entrez l'URL brute de GitHub", @@ -248,6 +249,8 @@ "Enter Model ID": "Entrez l'ID du modèle", "Enter model tag (e.g. {{modelTag}})": "Entrez l'étiquette du modèle (par ex. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Entrez le nombre d'étapes (par ex. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Entrez votre score", "Enter SearchApi API Key": "Entrez la clé API SearchApi", "Enter SearchApi Engine": "Entrez le moteur de recherche SearchApi", @@ -575,10 +578,13 @@ "Serpstack API Key": "Clé API Serpstack", "Server connection verified": "Connexion au serveur vérifiée", "Set as default": "Définir comme valeur par défaut", + "Set CFG Scale": "", "Set Default Model": "Définir le modèle par défaut", "Set embedding model (e.g. {{model}})": "Définir le modèle d'embedding (par ex. {{model}})", "Set Image Size": "Définir la taille de l'image", "Set reranking model (e.g. {{model}})": "Définir le modèle de ré-ranking (par ex. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Définir le nombre d'étapes", "Set Task Model": "Définir le modèle de tâche", "Set Voice": "Choisir la voix", diff --git a/src/lib/i18n/locales/he-IL/translation.json b/src/lib/i18n/locales/he-IL/translation.json index 1494b650d..23e96d1d2 100644 --- a/src/lib/i18n/locales/he-IL/translation.json +++ b/src/lib/i18n/locales/he-IL/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "הזן פרטים על עצמך כדי שLLMs יזכור", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "הזן מפתח API של חיפוש אמיץ", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "הזן חפיפת נתונים", "Enter Chunk Size": "הזן גודל נתונים", "Enter Github Raw URL": "הזן כתובת URL של Github Raw", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "הזן תג מודל (למשל {{modelTag}})", "Enter Number of Steps (e.g. 50)": "הזן מספר שלבים (למשל 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "הזן ציון", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "מפתח API של Serpstack", "Server connection verified": "החיבור לשרת אומת", "Set as default": "הגדר כברירת מחדל", + "Set CFG Scale": "", "Set Default Model": "הגדר מודל ברירת מחדל", "Set embedding model (e.g. {{model}})": "הגדר מודל הטמעה (למשל {{model}})", "Set Image Size": "הגדר גודל תמונה", "Set reranking model (e.g. {{model}})": "הגדר מודל דירוג מחדש (למשל {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "הגדר שלבים", "Set Task Model": "הגדרת מודל משימה", "Set Voice": "הגדר קול", diff --git a/src/lib/i18n/locales/hi-IN/translation.json b/src/lib/i18n/locales/hi-IN/translation.json index f6ad8cb45..068728a0d 100644 --- a/src/lib/i18n/locales/hi-IN/translation.json +++ b/src/lib/i18n/locales/hi-IN/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "अपने एलएलएम को याद करने के लिए अपने बारे में एक विवरण दर्ज करें", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Brave सर्च एपीआई कुंजी डालें", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "चंक ओवरलैप दर्ज करें", "Enter Chunk Size": "खंड आकार दर्ज करें", "Enter Github Raw URL": "Github Raw URL दर्ज करें", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Model tag दर्ज करें (उदा. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "चरणों की संख्या दर्ज करें (उदा. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "स्कोर दर्ज करें", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "सर्पस्टैक एपीआई कुंजी", "Server connection verified": "सर्वर कनेक्शन सत्यापित", "Set as default": "डिफाल्ट के रूप में सेट", + "Set CFG Scale": "", "Set Default Model": "डिफ़ॉल्ट मॉडल सेट करें", "Set embedding model (e.g. {{model}})": "ईम्बेडिंग मॉडल सेट करें (उदाहरण: {{model}})", "Set Image Size": "छवि का आकार सेट करें", "Set reranking model (e.g. {{model}})": "रीकरण मॉडल सेट करें (उदाहरण: {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "चरण निर्धारित करें", "Set Task Model": "कार्य मॉडल सेट करें", "Set Voice": "आवाज सेट करें", diff --git a/src/lib/i18n/locales/hr-HR/translation.json b/src/lib/i18n/locales/hr-HR/translation.json index d860bbce8..039cf73c8 100644 --- a/src/lib/i18n/locales/hr-HR/translation.json +++ b/src/lib/i18n/locales/hr-HR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Unesite pojedinosti o sebi da bi učitali memoriju u LLM", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Unesite Brave Search API ključ", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Unesite preklapanje dijelova", "Enter Chunk Size": "Unesite veličinu dijela", "Enter Github Raw URL": "Unesite Github sirovi URL", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Unesite oznaku modela (npr. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Unesite broj koraka (npr. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Unesite ocjenu", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Serpstack API API ključ", "Server connection verified": "Veza s poslužiteljem potvrđena", "Set as default": "Postavi kao zadano", + "Set CFG Scale": "", "Set Default Model": "Postavi zadani model", "Set embedding model (e.g. {{model}})": "Postavi model za embedding (npr. {{model}})", "Set Image Size": "Postavi veličinu slike", "Set reranking model (e.g. {{model}})": "Postavi model za ponovno rangiranje (npr. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Postavi korake", "Set Task Model": "Postavite model zadatka", "Set Voice": "Postavi glas", diff --git a/src/lib/i18n/locales/id-ID/translation.json b/src/lib/i18n/locales/id-ID/translation.json index 1ef3829b3..f12a5e83b 100644 --- a/src/lib/i18n/locales/id-ID/translation.json +++ b/src/lib/i18n/locales/id-ID/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Masukkan detail tentang diri Anda untuk diingat oleh LLM Anda", "Enter api auth string (e.g. username:password)": "Masukkan string pengesahan API (misalnya nama pengguna: kata sandi)", "Enter Brave Search API Key": "Masukkan Kunci API Pencarian Berani", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Masukkan Tumpang Tindih Chunk", "Enter Chunk Size": "Masukkan Ukuran Potongan", "Enter Github Raw URL": "Masukkan URL Mentah Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Masukkan tag model (misalnya {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Masukkan Jumlah Langkah (mis. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Masukkan Skor", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Kunci API Serpstack", "Server connection verified": "Koneksi server diverifikasi", "Set as default": "Ditetapkan sebagai default", + "Set CFG Scale": "", "Set Default Model": "Tetapkan Model Default", "Set embedding model (e.g. {{model}})": "Tetapkan model penyematan (mis. {{model}})", "Set Image Size": "Mengatur Ukuran Gambar", "Set reranking model (e.g. {{model}})": "Tetapkan model pemeringkatan ulang (mis. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Tetapkan Langkah", "Set Task Model": "Tetapkan Model Tugas", "Set Voice": "Mengatur Suara", diff --git a/src/lib/i18n/locales/it-IT/translation.json b/src/lib/i18n/locales/it-IT/translation.json index bc6185938..c4dd65249 100644 --- a/src/lib/i18n/locales/it-IT/translation.json +++ b/src/lib/i18n/locales/it-IT/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Inserisci un dettaglio su di te per che i LLM possano ricordare", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Inserisci la chiave API di Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Inserisci la sovrapposizione chunk", "Enter Chunk Size": "Inserisci la dimensione chunk", "Enter Github Raw URL": "Immettere l'URL grezzo di Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Inserisci il tag del modello (ad esempio {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Inserisci il numero di passaggi (ad esempio 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Inserisci il punteggio", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Chiave API Serpstack", "Server connection verified": "Connessione al server verificata", "Set as default": "Imposta come predefinito", + "Set CFG Scale": "", "Set Default Model": "Imposta modello predefinito", "Set embedding model (e.g. {{model}})": "Imposta modello di embedding (ad esempio {{model}})", "Set Image Size": "Imposta dimensione immagine", "Set reranking model (e.g. {{model}})": "Imposta modello di riclassificazione (ad esempio {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Imposta passaggi", "Set Task Model": "Imposta modello di attività", "Set Voice": "Imposta voce", diff --git a/src/lib/i18n/locales/ja-JP/translation.json b/src/lib/i18n/locales/ja-JP/translation.json index 500f755a8..dce3ca0ec 100644 --- a/src/lib/i18n/locales/ja-JP/translation.json +++ b/src/lib/i18n/locales/ja-JP/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "LLM が記憶するために、自分についての詳細を入力してください", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Brave Search APIキーの入力", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "チャンクオーバーラップを入力してください", "Enter Chunk Size": "チャンクサイズを入力してください", "Enter Github Raw URL": "Github Raw URLを入力", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "モデルタグを入力してください (例: {{modelTag}})", "Enter Number of Steps (e.g. 50)": "ステップ数を入力してください (例: 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "スコアを入力してください", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -573,10 +576,13 @@ "Serpstack API Key": "Serpstack APIキー", "Server connection verified": "サーバー接続が確認されました", "Set as default": "デフォルトに設定", + "Set CFG Scale": "", "Set Default Model": "デフォルトモデルを設定", "Set embedding model (e.g. {{model}})": "埋め込みモデルを設定します(例:{{model}})", "Set Image Size": "画像サイズを設定", "Set reranking model (e.g. {{model}})": "モデルを設定します(例:{{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "ステップを設定", "Set Task Model": "タスクモデルの設定", "Set Voice": "音声を設定", diff --git a/src/lib/i18n/locales/ka-GE/translation.json b/src/lib/i18n/locales/ka-GE/translation.json index 0965773a6..6a5444a45 100644 --- a/src/lib/i18n/locales/ka-GE/translation.json +++ b/src/lib/i18n/locales/ka-GE/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "შეიყვანე დეტალი ჩემთათვის, რომ ჩვენი LLMs-ს შეიძლოს აღაქვს", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "შეიყვანეთ Brave Search API გასაღები", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "შეიყვანეთ ნაწილის გადახურვა", "Enter Chunk Size": "შეიყვანე ბლოკის ზომა", "Enter Github Raw URL": "შეიყვანეთ Github Raw URL", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "შეიყვანეთ მოდელის ტეგი (მაგ. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "შეიყვანეთ ნაბიჯების რაოდენობა (მაგ. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "შეიყვანეთ ქულა", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API Key", "Server connection verified": "სერვერთან კავშირი დადასტურებულია", "Set as default": "დეფოლტად დაყენება", + "Set CFG Scale": "", "Set Default Model": "დეფოლტ მოდელის დაყენება", "Set embedding model (e.g. {{model}})": "ჩვენება მოდელის დაყენება (მაგ. {{model}})", "Set Image Size": "სურათის ზომის დაყენება", "Set reranking model (e.g. {{model}})": "რეტარირება მოდელის დაყენება (მაგ. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "ნაბიჯების დაყენება", "Set Task Model": "დააყენეთ სამუშაო მოდელი", "Set Voice": "ხმის დაყენება", diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json index 8f68ea8ce..240627197 100644 --- a/src/lib/i18n/locales/ko-KR/translation.json +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "자신에 대한 세부사항을 입력하여 LLM들이 기억할 수 있도록 하세요.", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Brave Search API Key 입력", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "청크 오버랩 입력", "Enter Chunk Size": "청크 크기 입력", "Enter Github Raw URL": "Github Raw URL 입력", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "모델 태그 입력(예: {{modelTag}})", "Enter Number of Steps (e.g. 50)": "단계 수 입력(예: 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "점수 입력", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API 키", "Server connection verified": "서버 연결 확인됨", "Set as default": "기본값으로 설정", + "Set CFG Scale": "", "Set Default Model": "기본 모델 설정", "Set embedding model (e.g. {{model}})": "임베딩 모델 설정 (예: {{model}})", "Set Image Size": "이미지 크기 설정", "Set reranking model (e.g. {{model}})": "reranking 모델 설정 (예: {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "단계 설정", "Set Task Model": "작업 모델 설정", "Set Voice": "음성 설정", diff --git a/src/lib/i18n/locales/lt-LT/translation.json b/src/lib/i18n/locales/lt-LT/translation.json index bf64da574..ac0d4c3b6 100644 --- a/src/lib/i18n/locales/lt-LT/translation.json +++ b/src/lib/i18n/locales/lt-LT/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Įveskite informaciją apie save jūsų modelio atminčiai", "Enter api auth string (e.g. username:password)": "Įveskite API autentifikacijos kodą (pvz. username:password)", "Enter Brave Search API Key": "Įveskite Bravo Search API raktą", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Įveskite blokų persidengimą", "Enter Chunk Size": "Įveskite blokų dydį", "Enter Github Raw URL": "Įveskite GitHub Raw nuorodą", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Įveskite modelio žymą (pvz. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Įveskite žingsnių kiekį (pvz. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Įveskite rezultatą", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -576,10 +579,13 @@ "Serpstack API Key": "Serpstach API raktas", "Server connection verified": "Serverio sujungimas patvirtintas", "Set as default": "Nustatyti numatytąjį", + "Set CFG Scale": "", "Set Default Model": "Nustatyti numatytąjį modelį", "Set embedding model (e.g. {{model}})": "Nustatyti embedding modelį", "Set Image Size": "Nustatyti paveikslėlių dydį", "Set reranking model (e.g. {{model}})": "Nustatyti reranking modelį", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Numatyti etapus", "Set Task Model": "Numatyti užduočių modelį", "Set Voice": "Numatyti balsą", diff --git a/src/lib/i18n/locales/ms-MY/translation.json b/src/lib/i18n/locales/ms-MY/translation.json index f1bf853d2..63295fa29 100644 --- a/src/lib/i18n/locales/ms-MY/translation.json +++ b/src/lib/i18n/locales/ms-MY/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Masukkan butiran tentang diri anda untuk diingati oleh LLM anda", "Enter api auth string (e.g. username:password)": "Masukkan kekunci auth api ( cth nama pengguna:kata laluan )", "Enter Brave Search API Key": "Masukkan Kekunci API carian Brave", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Masukkan Tindihan 'Chunk'", "Enter Chunk Size": "Masukkan Saiz 'Chunk'", "Enter Github Raw URL": "Masukkan URL 'Github Raw'", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Masukkan tag model (cth {{ modelTag }})", "Enter Number of Steps (e.g. 50)": "Masukkan Bilangan Langkah (cth 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Masukkan Skor", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Kunci API Serpstack", "Server connection verified": "Sambungan pelayan disahkan", "Set as default": "Tetapkan sebagai lalai", + "Set CFG Scale": "", "Set Default Model": "Tetapkan Model Lalai", "Set embedding model (e.g. {{model}})": "Tetapkan model benamkan (cth {{model}})", "Set Image Size": "Tetapkan saiz imej", "Set reranking model (e.g. {{model}})": "Tetapkan model 'reranking' (cth {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "tapkan Langkah", "Set Task Model": "Tetapkan Model Tugasan", "Set Voice": "Tetapan Suara", diff --git a/src/lib/i18n/locales/nb-NO/translation.json b/src/lib/i18n/locales/nb-NO/translation.json index 9a0304fc8..b5a599959 100644 --- a/src/lib/i18n/locales/nb-NO/translation.json +++ b/src/lib/i18n/locales/nb-NO/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Skriv inn en detalj om deg selv som språkmodellene dine kan huske", "Enter api auth string (e.g. username:password)": "Skriv inn api-autentiseringsstreng (f.eks. brukernavn:passord)", "Enter Brave Search API Key": "Skriv inn Brave Search API-nøkkel", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Skriv inn Chunk Overlap", "Enter Chunk Size": "Skriv inn Chunk-størrelse", "Enter Github Raw URL": "Skriv inn Github Raw-URL", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Skriv inn modelltag (f.eks. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Skriv inn antall steg (f.eks. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Skriv inn poengsum", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API-nøkkel", "Server connection verified": "Servertilkobling bekreftet", "Set as default": "Sett som standard", + "Set CFG Scale": "", "Set Default Model": "Sett standardmodell", "Set embedding model (e.g. {{model}})": "Sett embedding-modell (f.eks. {{model}})", "Set Image Size": "Sett bildestørrelse", "Set reranking model (e.g. {{model}})": "Sett reranking-modell (f.eks. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Sett steg", "Set Task Model": "Sett oppgavemodell", "Set Voice": "Sett stemme", diff --git a/src/lib/i18n/locales/nl-NL/translation.json b/src/lib/i18n/locales/nl-NL/translation.json index 63e01703d..a0ac8f4ce 100644 --- a/src/lib/i18n/locales/nl-NL/translation.json +++ b/src/lib/i18n/locales/nl-NL/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Voer een detail over jezelf in voor je LLMs om het her te onthouden", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Voer de Brave Search API-sleutel in", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Voeg Chunk Overlap toe", "Enter Chunk Size": "Voeg Chunk Size toe", "Enter Github Raw URL": "Voer de Github Raw-URL in", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Voeg model tag toe (Bijv. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Voeg aantal stappen toe (Bijv. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Voeg score toe", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API-sleutel", "Server connection verified": "Server verbinding geverifieerd", "Set as default": "Stel in als standaard", + "Set CFG Scale": "", "Set Default Model": "Stel Standaard Model in", "Set embedding model (e.g. {{model}})": "Stel embedding model in (bv. {{model}})", "Set Image Size": "Stel Afbeelding Grootte in", "Set reranking model (e.g. {{model}})": "Stel reranking model in (bv. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Stel Stappen in", "Set Task Model": "Taakmodel instellen", "Set Voice": "Stel Stem in", diff --git a/src/lib/i18n/locales/pa-IN/translation.json b/src/lib/i18n/locales/pa-IN/translation.json index 6c2c58e17..554112f49 100644 --- a/src/lib/i18n/locales/pa-IN/translation.json +++ b/src/lib/i18n/locales/pa-IN/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "ਤੁਹਾਡੇ LLMs ਨੂੰ ਸੁਨੇਹਾ ਕਰਨ ਲਈ ਸੁਨੇਹਾ ਇੱਥੇ ਦਰਜ ਕਰੋ", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "ਬਹਾਦਰ ਖੋਜ API ਕੁੰਜੀ ਦਾਖਲ ਕਰੋ", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "ਚੰਕ ਓਵਰਲੈਪ ਦਰਜ ਕਰੋ", "Enter Chunk Size": "ਚੰਕ ਆਕਾਰ ਦਰਜ ਕਰੋ", "Enter Github Raw URL": "Github ਕੱਚਾ URL ਦਾਖਲ ਕਰੋ", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "ਮਾਡਲ ਟੈਗ ਦਰਜ ਕਰੋ (ਉਦਾਹਰਣ ਲਈ {{modelTag}})", "Enter Number of Steps (e.g. 50)": "ਕਦਮਾਂ ਦੀ ਗਿਣਤੀ ਦਰਜ ਕਰੋ (ਉਦਾਹਰਣ ਲਈ 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "ਸਕੋਰ ਦਰਜ ਕਰੋ", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API ਕੁੰਜੀ", "Server connection verified": "ਸਰਵਰ ਕਨੈਕਸ਼ਨ ਦੀ ਪੁਸ਼ਟੀ ਕੀਤੀ ਗਈ", "Set as default": "ਮੂਲ ਵਜੋਂ ਸੈੱਟ ਕਰੋ", + "Set CFG Scale": "", "Set Default Model": "ਮੂਲ ਮਾਡਲ ਸੈੱਟ ਕਰੋ", "Set embedding model (e.g. {{model}})": "ਐਮਬੈੱਡਿੰਗ ਮਾਡਲ ਸੈੱਟ ਕਰੋ (ਉਦਾਹਰਣ ਲਈ {{model}})", "Set Image Size": "ਚਿੱਤਰ ਆਕਾਰ ਸੈੱਟ ਕਰੋ", "Set reranking model (e.g. {{model}})": "ਮੁੜ ਰੈਂਕਿੰਗ ਮਾਡਲ ਸੈੱਟ ਕਰੋ (ਉਦਾਹਰਣ ਲਈ {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "ਕਦਮ ਸੈੱਟ ਕਰੋ", "Set Task Model": "ਟਾਸਕ ਮਾਡਲ ਸੈੱਟ ਕਰੋ", "Set Voice": "ਆਵਾਜ਼ ਸੈੱਟ ਕਰੋ", diff --git a/src/lib/i18n/locales/pl-PL/translation.json b/src/lib/i18n/locales/pl-PL/translation.json index 442b40701..9b91c926d 100644 --- a/src/lib/i18n/locales/pl-PL/translation.json +++ b/src/lib/i18n/locales/pl-PL/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Wprowadź szczegóły o sobie, aby LLMs mogli pamiętać", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Wprowadź klucz API Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Wprowadź zakchodzenie bloku", "Enter Chunk Size": "Wprowadź rozmiar bloku", "Enter Github Raw URL": "Wprowadź nieprzetworzony adres URL usługi Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Wprowadź tag modelu (np. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Wprowadź liczbę kroków (np. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Wprowadź wynik", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -576,10 +579,13 @@ "Serpstack API Key": "Klucz API Serpstack", "Server connection verified": "Połączenie z serwerem zweryfikowane", "Set as default": "Ustaw jako domyślne", + "Set CFG Scale": "", "Set Default Model": "Ustaw domyślny model", "Set embedding model (e.g. {{model}})": "Ustaw model osadzania (e.g. {{model}})", "Set Image Size": "Ustaw rozmiar obrazu", "Set reranking model (e.g. {{model}})": "Ustaw zmianę rankingu modelu (e.g. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Ustaw kroki", "Set Task Model": "Ustawianie modelu zadań", "Set Voice": "Ustaw głos", diff --git a/src/lib/i18n/locales/pt-BR/translation.json b/src/lib/i18n/locales/pt-BR/translation.json index c4a6ce89a..b18cb3233 100644 --- a/src/lib/i18n/locales/pt-BR/translation.json +++ b/src/lib/i18n/locales/pt-BR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Digite um detalhe sobre você para seus LLMs lembrarem", "Enter api auth string (e.g. username:password)": "Digite a string de autenticação da API (por exemplo, username:password)", "Enter Brave Search API Key": "Digite a Chave API do Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Digite a Sobreposição de Chunk", "Enter Chunk Size": "Digite o Tamanho do Chunk", "Enter Github Raw URL": "Digite a URL bruta do Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Digite a tag do modelo (por exemplo, {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Digite o Número de Passos (por exemplo, 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Digite a Pontuação", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Chave da API Serpstack", "Server connection verified": "Conexão com o servidor verificada", "Set as default": "Definir como padrão", + "Set CFG Scale": "", "Set Default Model": "Definir Modelo Padrão", "Set embedding model (e.g. {{model}})": "Definir modelo de embedding (por exemplo, {{model}})", "Set Image Size": "Definir Tamanho da Imagem", "Set reranking model (e.g. {{model}})": "Definir modelo de reclassificação (por exemplo, {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Definir Etapas", "Set Task Model": "Definir Modelo de Tarefa", "Set Voice": "Definir Voz", diff --git a/src/lib/i18n/locales/pt-PT/translation.json b/src/lib/i18n/locales/pt-PT/translation.json index d69fc70d7..a78deab29 100644 --- a/src/lib/i18n/locales/pt-PT/translation.json +++ b/src/lib/i18n/locales/pt-PT/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Escreva um detalhe sobre você para que os seus LLMs possam lembrar-se", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Escreva a chave da API do Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Escreva a Sobreposição de Fragmento", "Enter Chunk Size": "Escreva o Tamanho do Fragmento", "Enter Github Raw URL": "Escreva o URL cru do Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Escreva a tag do modelo (por exemplo, {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Escreva o Número de Etapas (por exemplo, 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Escreva a Pontuação", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Chave da API Serpstack", "Server connection verified": "Conexão com o servidor verificada", "Set as default": "Definir como padrão", + "Set CFG Scale": "", "Set Default Model": "Definir Modelo Padrão", "Set embedding model (e.g. {{model}})": "Definir modelo de vetorização (ex.: {{model}})", "Set Image Size": "Definir Tamanho da Imagem", "Set reranking model (e.g. {{model}})": "Definir modelo de reranking (ex.: {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Definir Etapas", "Set Task Model": "Definir modelo de tarefa", "Set Voice": "Definir Voz", diff --git a/src/lib/i18n/locales/ro-RO/translation.json b/src/lib/i18n/locales/ro-RO/translation.json index 6e4a3d01f..7cbf5d485 100644 --- a/src/lib/i18n/locales/ro-RO/translation.json +++ b/src/lib/i18n/locales/ro-RO/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Introduceți un detaliu despre dvs. pe care LLM-urile să-l rețină", "Enter api auth string (e.g. username:password)": "Introduceți șirul de autentificare API (de ex. username:password)", "Enter Brave Search API Key": "Introduceți Cheia API Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Introduceți Suprapunerea Blocului", "Enter Chunk Size": "Introduceți Dimensiunea Blocului", "Enter Github Raw URL": "Introduceți URL-ul Raw de pe Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Introduceți eticheta modelului (de ex. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Introduceți Numărul de Pași (de ex. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Introduceți Scorul", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Cheie API Serpstack", "Server connection verified": "Conexiunea la server a fost verificată", "Set as default": "Setează ca implicit", + "Set CFG Scale": "", "Set Default Model": "Setează Modelul Implicit", "Set embedding model (e.g. {{model}})": "Setează modelul de încapsulare (de ex. {{model}})", "Set Image Size": "Setează Dimensiunea Imaginilor", "Set reranking model (e.g. {{model}})": "Setează modelul de rearanjare (de ex. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Setează Pași", "Set Task Model": "Setează Model de Sarcină", "Set Voice": "Setează Voce", diff --git a/src/lib/i18n/locales/ru-RU/translation.json b/src/lib/i18n/locales/ru-RU/translation.json index bb258b9f7..29f677adf 100644 --- a/src/lib/i18n/locales/ru-RU/translation.json +++ b/src/lib/i18n/locales/ru-RU/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Введите детали о себе, чтобы LLMs могли запомнить", "Enter api auth string (e.g. username:password)": "Введите строку авторизации api (например, username:password)", "Enter Brave Search API Key": "Введите ключ API поиска Brave", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Введите перекрытие фрагмента", "Enter Chunk Size": "Введите размер фрагмента", "Enter Github Raw URL": "Введите необработанный URL-адрес Github", @@ -248,6 +249,8 @@ "Enter Model ID": "Введите ID модели", "Enter model tag (e.g. {{modelTag}})": "Введите тег модели (например, {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Введите количество шагов (например, 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Введите оценку", "Enter SearchApi API Key": "Введите ключ API SearchApi", "Enter SearchApi Engine": "Введите SearchApi движок", @@ -576,10 +579,13 @@ "Serpstack API Key": "Ключ API Serpstack", "Server connection verified": "Соединение с сервером проверено", "Set as default": "Установить по умолчанию", + "Set CFG Scale": "", "Set Default Model": "Установить модель по умолчанию", "Set embedding model (e.g. {{model}})": "Установить модель эмбеддинга (например, {{model}})", "Set Image Size": "Установить размер изображения", "Set reranking model (e.g. {{model}})": "Установить модель реранжирования (например, {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Установить шаги", "Set Task Model": "Установить модель задачи", "Set Voice": "Установить голос", diff --git a/src/lib/i18n/locales/sr-RS/translation.json b/src/lib/i18n/locales/sr-RS/translation.json index e0914f4b5..11b657977 100644 --- a/src/lib/i18n/locales/sr-RS/translation.json +++ b/src/lib/i18n/locales/sr-RS/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Унесите детаље за себе да ће LLMs преузимати", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Унесите БРАВЕ Сеарцх АПИ кључ", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Унесите преклапање делова", "Enter Chunk Size": "Унесите величину дела", "Enter Github Raw URL": "Унесите Гитхуб Раw УРЛ адресу", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Унесите ознаку модела (нпр. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Унесите број корака (нпр. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Унесите резултат", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -575,10 +578,13 @@ "Serpstack API Key": "Серпстацк АПИ кључ", "Server connection verified": "Веза са сервером потврђена", "Set as default": "Подеси као подразумевано", + "Set CFG Scale": "", "Set Default Model": "Подеси као подразумевани модел", "Set embedding model (e.g. {{model}})": "Подеси модел уградње (нпр. {{model}})", "Set Image Size": "Подеси величину слике", "Set reranking model (e.g. {{model}})": "Подеси модел поновног рангирања (нпр. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Подеси кораке", "Set Task Model": "Постављање модела задатка", "Set Voice": "Подеси глас", diff --git a/src/lib/i18n/locales/sv-SE/translation.json b/src/lib/i18n/locales/sv-SE/translation.json index 475cfb066..3fa3fab98 100644 --- a/src/lib/i18n/locales/sv-SE/translation.json +++ b/src/lib/i18n/locales/sv-SE/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Skriv en detalj om dig själv för att dina LLMs ska komma ihåg", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "Ange API-nyckel för Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Ange chunköverlappning", "Enter Chunk Size": "Ange chunkstorlek", "Enter Github Raw URL": "Ange Github Raw URL", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Ange modelltagg (t.ex. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Ange antal steg (t.ex. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Ange betyg", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API-nyckel", "Server connection verified": "Serveranslutning verifierad", "Set as default": "Ange som standard", + "Set CFG Scale": "", "Set Default Model": "Ange standardmodell", "Set embedding model (e.g. {{model}})": "Ställ in embedding modell (t.ex. {{model}})", "Set Image Size": "Ange bildstorlek", "Set reranking model (e.g. {{model}})": "Ställ in reranking modell (t.ex. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Ange steg", "Set Task Model": "Ange uppgiftsmodell", "Set Voice": "Ange röst", diff --git a/src/lib/i18n/locales/th-TH/translation.json b/src/lib/i18n/locales/th-TH/translation.json index b87d5a0ea..975ca3e10 100644 --- a/src/lib/i18n/locales/th-TH/translation.json +++ b/src/lib/i18n/locales/th-TH/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "ใส่รายละเอียดเกี่ยวกับตัวคุณสำหรับ LLMs ของคุณให้จดจำ", "Enter api auth string (e.g. username:password)": "ใส่สตริงการตรวจสอบ API (เช่น username:password)", "Enter Brave Search API Key": "ใส่คีย์ API ของ Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "ใส่การทับซ้อนส่วนข้อมูล", "Enter Chunk Size": "ใส่ขนาดส่วนข้อมูล", "Enter Github Raw URL": "ใส่ URL ดิบของ Github", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "ใส่แท็กโมเดล (เช่น {{modelTag}})", "Enter Number of Steps (e.g. 50)": "ใส่จำนวนขั้นตอน (เช่น 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "ใส่คะแนน", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "คีย์ API ของ Serpstack", "Server connection verified": "ยืนยันการเชื่อมต่อเซิร์ฟเวอร์แล้ว", "Set as default": "ตั้งเป็นค่าเริ่มต้น", + "Set CFG Scale": "", "Set Default Model": "ตั้งโมเดลเริ่มต้น", "Set embedding model (e.g. {{model}})": "ตั้งค่าโมเดลการฝัง (เช่น {{model}})", "Set Image Size": "ตั้งค่าขนาดภาพ", "Set reranking model (e.g. {{model}})": "ตั้งค่าโมเดลการจัดอันดับใหม่ (เช่น {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "ตั้งค่าขั้นตอน", "Set Task Model": "ตั้งค่าโมเดลงาน", "Set Voice": "ตั้งค่าเสียง", diff --git a/src/lib/i18n/locales/tk-TW/translation.json b/src/lib/i18n/locales/tk-TW/translation.json index ea56eb344..cbfa7e34a 100644 --- a/src/lib/i18n/locales/tk-TW/translation.json +++ b/src/lib/i18n/locales/tk-TW/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "", "Enter api auth string (e.g. username:password)": "", "Enter Brave Search API Key": "", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "", "Enter Chunk Size": "", "Enter Github Raw URL": "", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "", "Enter Number of Steps (e.g. 50)": "", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "", "Server connection verified": "", "Set as default": "", + "Set CFG Scale": "", "Set Default Model": "", "Set embedding model (e.g. {{model}})": "", "Set Image Size": "", "Set reranking model (e.g. {{model}})": "", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "", "Set Task Model": "", "Set Voice": "", diff --git a/src/lib/i18n/locales/tr-TR/translation.json b/src/lib/i18n/locales/tr-TR/translation.json index eb5a59d1b..5ade4b0b8 100644 --- a/src/lib/i18n/locales/tr-TR/translation.json +++ b/src/lib/i18n/locales/tr-TR/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "LLM'lerinizin hatırlaması için kendiniz hakkında bir bilgi girin", "Enter api auth string (e.g. username:password)": "Api auth dizesini girin (örn. kullanıcı adı:parola)", "Enter Brave Search API Key": "Brave Search API Anahtarını Girin", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Chunk Örtüşmesini Girin", "Enter Chunk Size": "Chunk Boyutunu Girin", "Enter Github Raw URL": "Github Raw URL'sini girin", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Model etiketini girin (örn. {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Adım Sayısını Girin (örn. 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Skoru Girin", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API Anahtarı", "Server connection verified": "Sunucu bağlantısı doğrulandı", "Set as default": "Varsayılan olarak ayarla", + "Set CFG Scale": "", "Set Default Model": "Varsayılan Modeli Ayarla", "Set embedding model (e.g. {{model}})": "Gömme modelini ayarlayın (örn. {{model}})", "Set Image Size": "Görüntü Boyutunu Ayarla", "Set reranking model (e.g. {{model}})": "Yeniden sıralama modelini ayarlayın (örn. {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Adımları Ayarla", "Set Task Model": "Görev Modeli Ayarla", "Set Voice": "Ses Ayarla", diff --git a/src/lib/i18n/locales/uk-UA/translation.json b/src/lib/i18n/locales/uk-UA/translation.json index cca04d83f..5880887ed 100644 --- a/src/lib/i18n/locales/uk-UA/translation.json +++ b/src/lib/i18n/locales/uk-UA/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Введіть відомості про себе для запам'ятовування вашими LLM.", "Enter api auth string (e.g. username:password)": "Введіть рядок авторизації api (напр, ім'я користувача:пароль)", "Enter Brave Search API Key": "Введіть ключ API для пошуку Brave", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Введіть перекриття фрагменту", "Enter Chunk Size": "Введіть розмір фрагменту", "Enter Github Raw URL": "Введіть Raw URL-адресу Github", @@ -248,6 +249,8 @@ "Enter Model ID": "Введіть ID моделі", "Enter model tag (e.g. {{modelTag}})": "Введіть тег моделі (напр., {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Введіть кількість кроків (напр., 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Введіть бал", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -576,10 +579,13 @@ "Serpstack API Key": "Ключ API Serpstack", "Server connection verified": "З'єднання з сервером підтверджено", "Set as default": "Встановити за замовчуванням", + "Set CFG Scale": "", "Set Default Model": "Встановити модель за замовчуванням", "Set embedding model (e.g. {{model}})": "Встановити модель вбудовування (напр, {{model}})", "Set Image Size": "Встановити розмір зображення", "Set reranking model (e.g. {{model}})": "Встановити модель переранжування (напр., {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Встановити кроки", "Set Task Model": "Встановити модель задач", "Set Voice": "Встановити голос", diff --git a/src/lib/i18n/locales/vi-VN/translation.json b/src/lib/i18n/locales/vi-VN/translation.json index fb8d814ae..da67789c7 100644 --- a/src/lib/i18n/locales/vi-VN/translation.json +++ b/src/lib/i18n/locales/vi-VN/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Nhập chi tiết về bản thân của bạn để LLMs có thể nhớ", "Enter api auth string (e.g. username:password)": "Nhập chuỗi xác thực api (ví dụ: username: mật khẩu)", "Enter Brave Search API Key": "Nhập API key cho Brave Search", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "Nhập Chunk chồng lấn (overlap)", "Enter Chunk Size": "Nhập Kích thước Chunk", "Enter Github Raw URL": "Nhập URL cho Github Raw", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "Nhập thẻ mô hình (vd: {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Nhập số Steps (vd: 50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "Nhập Score", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -573,10 +576,13 @@ "Serpstack API Key": "Khóa API Serpstack", "Server connection verified": "Kết nối máy chủ đã được xác minh", "Set as default": "Đặt làm mặc định", + "Set CFG Scale": "", "Set Default Model": "Đặt Mô hình Mặc định", "Set embedding model (e.g. {{model}})": "Thiết lập mô hình embedding (ví dụ: {{model}})", "Set Image Size": "Đặt Kích thước ảnh", "Set reranking model (e.g. {{model}})": "Thiết lập mô hình reranking (ví dụ: {{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "Đặt Số Bước", "Set Task Model": "Đặt Mô hình Tác vụ", "Set Voice": "Đặt Giọng nói", diff --git a/src/lib/i18n/locales/zh-CN/translation.json b/src/lib/i18n/locales/zh-CN/translation.json index c5fc4ae41..0730638e8 100644 --- a/src/lib/i18n/locales/zh-CN/translation.json +++ b/src/lib/i18n/locales/zh-CN/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "输入一个关于你自己的详细信息,方便你的大语言模型记住这些内容", "Enter api auth string (e.g. username:password)": "输入api鉴权路径 (例如:username:password)", "Enter Brave Search API Key": "输入 Brave Search API 密钥", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "输入块重叠 (Chunk Overlap)", "Enter Chunk Size": "输入块大小 (Chunk Size)", "Enter Github Raw URL": "输入 Github Raw 地址", @@ -248,6 +249,8 @@ "Enter Model ID": "输入模型 ID", "Enter model tag (e.g. {{modelTag}})": "输入模型标签 (例如:{{modelTag}})", "Enter Number of Steps (e.g. 50)": "输入步骤数 (Steps) (例如:50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "输入评分", "Enter SearchApi API Key": "输入 SearchApi API 密钥", "Enter SearchApi Engine": "输入 SearchApi 引擎", @@ -573,10 +576,13 @@ "Serpstack API Key": "Serpstack API 密钥", "Server connection verified": "已验证服务器连接", "Set as default": "设为默认", + "Set CFG Scale": "", "Set Default Model": "设置默认模型", "Set embedding model (e.g. {{model}})": "设置语义向量模型 (例如:{{model}})", "Set Image Size": "设置图片分辨率", "Set reranking model (e.g. {{model}})": "设置重排模型 (例如:{{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "设置步骤", "Set Task Model": "设置任务模型", "Set Voice": "设置音色", diff --git a/src/lib/i18n/locales/zh-TW/translation.json b/src/lib/i18n/locales/zh-TW/translation.json index b76009d42..653166bdc 100644 --- a/src/lib/i18n/locales/zh-TW/translation.json +++ b/src/lib/i18n/locales/zh-TW/translation.json @@ -238,6 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "輸入有關您的詳細資訊,讓您的大型語言模型可以回想起來", "Enter api auth string (e.g. username:password)": "輸入 API 驗證字串(例如:username:password)", "Enter Brave Search API Key": "輸入 Brave 搜尋 API 金鑰", + "Enter CFG Scale (e.g. 7.0)": "", "Enter Chunk Overlap": "輸入區塊重疊", "Enter Chunk Size": "輸入區塊大小", "Enter Github Raw URL": "輸入 GitHub Raw URL", @@ -248,6 +249,8 @@ "Enter Model ID": "", "Enter model tag (e.g. {{modelTag}})": "輸入模型標籤(例如:{{modelTag}})", "Enter Number of Steps (e.g. 50)": "輸入步驟數(例如:50)", + "Enter Sampler (e.g. Euler a)": "", + "Enter Scheduler (e.g. Karras)": "", "Enter Score": "輸入分數", "Enter SearchApi API Key": "", "Enter SearchApi Engine": "", @@ -574,10 +577,13 @@ "Serpstack API Key": "Serpstack API 金鑰", "Server connection verified": "伺服器連線已驗證", "Set as default": "設為預設", + "Set CFG Scale": "", "Set Default Model": "設定預設模型", "Set embedding model (e.g. {{model}})": "設定嵌入模型(例如:{{model}})", "Set Image Size": "設定圖片大小", "Set reranking model (e.g. {{model}})": "設定重新排序模型(例如:{{model}})", + "Set Sampler": "", + "Set Scheduler": "", "Set Steps": "設定步數", "Set Task Model": "設定任務模型", "Set Voice": "設定語音", From 7df997c9926f0850107a543059566e9babab85cc Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 00:49:23 -0400 Subject: [PATCH 043/143] chore: format --- backend/open_webui/apps/images/main.py | 23 +++++++++++++++++------ backend/open_webui/config.py | 5 ++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/backend/open_webui/apps/images/main.py b/backend/open_webui/apps/images/main.py index 390273a26..1074e2cb0 100644 --- a/backend/open_webui/apps/images/main.py +++ b/backend/open_webui/apps/images/main.py @@ -144,10 +144,22 @@ async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)): app.state.config.AUTOMATIC1111_API_AUTH = ( form_data.automatic1111.AUTOMATIC1111_API_AUTH ) - - app.state.config.AUTOMATIC1111_CFG_SCALE = float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE) if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE != "" else None - app.state.config.AUTOMATIC1111_SAMPLER = form_data.automatic1111.AUTOMATIC1111_SAMPLER if form_data.automatic1111.AUTOMATIC1111_SAMPLER != "" else None - app.state.config.AUTOMATIC1111_SCHEDULER = form_data.automatic1111.AUTOMATIC1111_SCHEDULER if form_data.automatic1111.AUTOMATIC1111_SCHEDULER != "" else None + + app.state.config.AUTOMATIC1111_CFG_SCALE = ( + float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE) + if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE != "" + else None + ) + app.state.config.AUTOMATIC1111_SAMPLER = ( + form_data.automatic1111.AUTOMATIC1111_SAMPLER + if form_data.automatic1111.AUTOMATIC1111_SAMPLER != "" + else None + ) + app.state.config.AUTOMATIC1111_SCHEDULER = ( + form_data.automatic1111.AUTOMATIC1111_SCHEDULER + if form_data.automatic1111.AUTOMATIC1111_SCHEDULER != "" + else None + ) app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/") app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW @@ -285,7 +297,6 @@ async def update_image_config(form_data: ImageConfigForm, user=Depends(get_admin detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 50)."), ) - return { "MODEL": app.state.config.MODEL, "IMAGE_SIZE": app.state.config.IMAGE_SIZE, @@ -543,7 +554,7 @@ async def image_generations( if form_data.negative_prompt is not None: data["negative_prompt"] = form_data.negative_prompt - + if app.state.config.AUTOMATIC1111_CFG_SCALE: data["cfg_scale"] = app.state.config.AUTOMATIC1111_CFG_SCALE diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 261e66b44..439e82e43 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1236,8 +1236,7 @@ AUTOMATIC1111_SAMPLER = PersistentConfig( os.environ.get("AUTOMATIC1111_SAMPLER") if os.environ.get("AUTOMATIC1111_SAMPLER") else None - ) - + ), ) AUTOMATIC1111_SCHEDULER = PersistentConfig( @@ -1247,7 +1246,7 @@ AUTOMATIC1111_SCHEDULER = PersistentConfig( os.environ.get("AUTOMATIC1111_SCHEDULER") if os.environ.get("AUTOMATIC1111_SCHEDULER") else None - ) + ), ) COMFYUI_BASE_URL = PersistentConfig( From a9c497612ba7f396d5969c16b223b47e691accc7 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 00:56:50 -0400 Subject: [PATCH 044/143] refac: rm assert --- backend/open_webui/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 49a559d58..15f41be69 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -589,10 +589,11 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): if prompt is None: raise Exception("No user message found") if rag_app.state.config.RELEVANCE_THRESHOLD == 0: - assert context_string.strip(), ( - "With a 0 relevancy threshold for RAG, the context cannot " - "be empty" - ) + if context_string.strip() == "": + log.debug( + f"With a 0 relevancy threshold for RAG, the context cannot be empty" + ) + # Workaround for Ollama 2.0+ system prompt issue # TODO: replace with add_or_update_system_message if model["owned_by"] == "ollama": From 8a4b3e6bc9cbd71d62cd8cadb65e104f3f305b45 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:06:51 -0400 Subject: [PATCH 045/143] refac: allow multiple [context] in prompt --- backend/open_webui/apps/rag/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 22f34c6a9..efa22841d 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -239,10 +239,8 @@ def query_collection_with_hybrid_search( def rag_template(template: str, context: str, query: str): count = template.count("[context]") - assert ( - count == 1 - ), f"RAG template contains an unexpected number of '[context]' : {count}" assert "[context]" in template, "RAG template does not contain '[context]'" + if "" in context and "" in context: log.debug( "WARNING: Potential prompt injection attack: the RAG " From a1f3ece5289b8d862c8e6265357aa3d2ae21b4af Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:07:03 -0400 Subject: [PATCH 046/143] refac --- backend/open_webui/main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 15f41be69..cb2364da6 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -586,13 +586,16 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): if len(contexts) > 0: context_string = "/n".join(contexts).strip() prompt = get_last_user_message(body["messages"]) + if prompt is None: raise Exception("No user message found") - if rag_app.state.config.RELEVANCE_THRESHOLD == 0: - if context_string.strip() == "": - log.debug( - f"With a 0 relevancy threshold for RAG, the context cannot be empty" - ) + if ( + rag_app.state.config.RELEVANCE_THRESHOLD == 0 + and context_string.strip() == "" + ): + log.debug( + f"With a 0 relevancy threshold for RAG, the context cannot be empty" + ) # Workaround for Ollama 2.0+ system prompt issue # TODO: replace with add_or_update_system_message From b943b7d3379644eb3f284ac4f4b42507032b5eff Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:08:02 -0400 Subject: [PATCH 047/143] refac --- backend/open_webui/apps/rag/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index efa22841d..82daaf438 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -249,8 +249,8 @@ def rag_template(template: str, context: str, query: str): ) if "[query]" in context: - query_placeholder = str(uuid.uuid4()) - template = template.replace("[QUERY]", query_placeholder) + query_placeholder = f"[query-{str(uuid.uuid4())}]" + template = template.replace("[query]", query_placeholder) template = template.replace("[context]", context) template = template.replace(query_placeholder, query) else: From 939bfd153e09754a32589a0ab8d3e34b73949c23 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:18:20 -0400 Subject: [PATCH 048/143] refac --- backend/open_webui/apps/rag/utils.py | 16 ++++++---- .../open_webui/apps/rag/vector/dbs/chroma.py | 32 +++++++++++++------ .../open_webui/apps/rag/vector/dbs/milvus.py | 23 +++++++------ backend/open_webui/apps/rag/vector/main.py | 7 ++-- 4 files changed, 49 insertions(+), 29 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 82daaf438..274a84c92 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -48,9 +48,9 @@ class VectorSearchRetriever(BaseRetriever): limit=self.top_k, ) - ids = result["ids"][0] - metadatas = result["metadatas"][0] - documents = result["documents"][0] + ids = result.ids[0] + metadatas = result.metadatas[0] + documents = result.documents[0] results = [] for idx in range(len(ids)): @@ -194,7 +194,7 @@ def query_collection( k=k, embedding_function=embedding_function, ) - results.append(result) + results.append(result.model_dump()) except Exception as e: log.exception(f"Error when querying the collection: {e}") else: @@ -212,7 +212,7 @@ def query_collection_with_hybrid_search( r: float, ) -> dict: results = [] - failed = 0 + error = False for collection_name in collection_names: try: result = query_doc_with_hybrid_search( @@ -228,12 +228,14 @@ def query_collection_with_hybrid_search( log.exception( "Error when querying the collection with " f"hybrid_search: {e}" ) - failed += 1 - if failed == len(collection_names): + error = True + + if error: raise Exception( "Hybrid search failed for all collections. Using " "Non hybrid search as fallback." ) + return merge_and_sort_query_results(results, k=k, reverse=True) diff --git a/backend/open_webui/apps/rag/vector/dbs/chroma.py b/backend/open_webui/apps/rag/vector/dbs/chroma.py index 9115fb9f5..7927d9ad4 100644 --- a/backend/open_webui/apps/rag/vector/dbs/chroma.py +++ b/backend/open_webui/apps/rag/vector/dbs/chroma.py @@ -4,7 +4,7 @@ from chromadb.utils.batch_utils import create_batches from typing import Optional -from open_webui.apps.rag.vector.main import VectorItem, QueryResult +from open_webui.apps.rag.vector.main import VectorItem, SearchResult, GetResult from open_webui.config import ( CHROMA_DATA_PATH, CHROMA_HTTP_HOST, @@ -47,7 +47,7 @@ class ChromaClient: def search( self, collection_name: str, vectors: list[list[float | int]], limit: int - ) -> Optional[QueryResult]: + ) -> Optional[SearchResult]: # Search for the nearest neighbor items based on the vectors and return 'limit' number of results. collection = self.client.get_collection(name=collection_name) if collection: @@ -56,19 +56,31 @@ class ChromaClient: n_results=limit, ) - return { - "ids": result["ids"], - "distances": result["distances"], - "documents": result["documents"], - "metadatas": result["metadatas"], - } + return SearchResult( + **{ + "ids": result["ids"], + "distances": result["distances"], + "documents": result["documents"], + "metadatas": result["metadatas"], + } + ) return None - def get(self, collection_name: str) -> Optional[QueryResult]: + def get(self, collection_name: str) -> Optional[GetResult]: # Get all the items in the collection. collection = self.client.get_collection(name=collection_name) if collection: - return collection.get() + + result = collection.get() + + return GetResult( + **{ + "ids": [result["ids"]], + "distances": [result["distances"]], + "documents": [result["documents"]], + "metadatas": [result["metadatas"]], + } + ) return None def insert(self, collection_name: str, items: list[VectorItem]): diff --git a/backend/open_webui/apps/rag/vector/dbs/milvus.py b/backend/open_webui/apps/rag/vector/dbs/milvus.py index 260aa687e..6e98efeec 100644 --- a/backend/open_webui/apps/rag/vector/dbs/milvus.py +++ b/backend/open_webui/apps/rag/vector/dbs/milvus.py @@ -4,7 +4,7 @@ import json from typing import Optional -from open_webui.apps.rag.vector.main import VectorItem, QueryResult +from open_webui.apps.rag.vector.main import VectorItem, SearchResult, GetResult from open_webui.config import ( MILVUS_URI, ) @@ -15,7 +15,7 @@ class MilvusClient: self.collection_prefix = "open_webui" self.client = Client(uri=MILVUS_URI) - def _result_to_query_result(self, result) -> QueryResult: + def _result_to_query_result(self, result) -> SearchResult: print(result) ids = [] @@ -40,12 +40,14 @@ class MilvusClient: documents.append(_documents) metadatas.append(_metadatas) - return { - "ids": ids, - "distances": distances, - "documents": documents, - "metadatas": metadatas, - } + return SearchResult( + **{ + "ids": ids, + "distances": distances, + "documents": documents, + "metadatas": metadatas, + } + ) def _create_collection(self, collection_name: str, dimension: int): schema = self.client.create_schema( @@ -94,7 +96,7 @@ class MilvusClient: def search( self, collection_name: str, vectors: list[list[float | int]], limit: int - ) -> Optional[QueryResult]: + ) -> Optional[SearchResult]: # Search for the nearest neighbor items based on the vectors and return 'limit' number of results. result = self.client.search( collection_name=f"{self.collection_prefix}_{collection_name}", @@ -105,10 +107,11 @@ class MilvusClient: return self._result_to_query_result(result) - def get(self, collection_name: str) -> Optional[QueryResult]: + def get(self, collection_name: str) -> Optional[GetResult]: # Get all the items in the collection. result = self.client.query( collection_name=f"{self.collection_prefix}_{collection_name}", + filter='id != ""', ) return self._result_to_query_result(result) diff --git a/backend/open_webui/apps/rag/vector/main.py b/backend/open_webui/apps/rag/vector/main.py index 5b5a8ea38..f0cf0c038 100644 --- a/backend/open_webui/apps/rag/vector/main.py +++ b/backend/open_webui/apps/rag/vector/main.py @@ -9,8 +9,11 @@ class VectorItem(BaseModel): metadata: Any -class QueryResult(BaseModel): +class GetResult(BaseModel): ids: Optional[List[List[str]]] - distances: Optional[List[List[float | int]]] documents: Optional[List[List[str]]] metadatas: Optional[List[List[Any]]] + + +class SearchResult(GetResult): + distances: Optional[List[List[float | int]]] From 823093eea64a4adcd5abb5894fa07a5a0e719d57 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:21:47 -0400 Subject: [PATCH 049/143] fix: hybrid search --- backend/open_webui/apps/rag/utils.py | 4 ++-- backend/open_webui/apps/rag/vector/dbs/chroma.py | 3 --- backend/open_webui/apps/rag/vector/dbs/milvus.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 274a84c92..bdec5f9da 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -97,8 +97,8 @@ def query_doc_with_hybrid_search( result = VECTOR_DB_CLIENT.get(collection_name=collection_name) bm25_retriever = BM25Retriever.from_texts( - texts=result.documents, - metadatas=result.metadatas, + texts=result.documents[0], + metadatas=result.metadatas[0], ) bm25_retriever.k = k diff --git a/backend/open_webui/apps/rag/vector/dbs/chroma.py b/backend/open_webui/apps/rag/vector/dbs/chroma.py index 7927d9ad4..5f9420108 100644 --- a/backend/open_webui/apps/rag/vector/dbs/chroma.py +++ b/backend/open_webui/apps/rag/vector/dbs/chroma.py @@ -70,13 +70,10 @@ class ChromaClient: # Get all the items in the collection. collection = self.client.get_collection(name=collection_name) if collection: - result = collection.get() - return GetResult( **{ "ids": [result["ids"]], - "distances": [result["distances"]], "documents": [result["documents"]], "metadatas": [result["metadatas"]], } diff --git a/backend/open_webui/apps/rag/vector/dbs/milvus.py b/backend/open_webui/apps/rag/vector/dbs/milvus.py index 6e98efeec..cdc8d0b08 100644 --- a/backend/open_webui/apps/rag/vector/dbs/milvus.py +++ b/backend/open_webui/apps/rag/vector/dbs/milvus.py @@ -113,7 +113,7 @@ class MilvusClient: collection_name=f"{self.collection_prefix}_{collection_name}", filter='id != ""', ) - return self._result_to_query_result(result) + return GetResult(**self._result_to_query_result(result)) def insert(self, collection_name: str, items: list[VectorItem]): # Insert the items into the collection, if the collection does not exist, it will be created. From f549cb1f87109bb31e096334262135205abce40a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 01:30:30 -0400 Subject: [PATCH 050/143] fix --- .../open_webui/apps/rag/vector/dbs/milvus.py | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/apps/rag/vector/dbs/milvus.py b/backend/open_webui/apps/rag/vector/dbs/milvus.py index cdc8d0b08..f205b9521 100644 --- a/backend/open_webui/apps/rag/vector/dbs/milvus.py +++ b/backend/open_webui/apps/rag/vector/dbs/milvus.py @@ -15,7 +15,36 @@ class MilvusClient: self.collection_prefix = "open_webui" self.client = Client(uri=MILVUS_URI) - def _result_to_query_result(self, result) -> SearchResult: + def _result_to_get_result(self, result) -> GetResult: + print(result) + + ids = [] + documents = [] + metadatas = [] + + for match in result: + _ids = [] + _documents = [] + _metadatas = [] + + for item in match: + _ids.append(item.get("id")) + _documents.append(item.get("data", {}).get("text")) + _metadatas.append(item.get("metadata")) + + ids.append(_ids) + documents.append(_documents) + metadatas.append(_metadatas) + + return GetResult( + **{ + "ids": ids, + "documents": documents, + "metadatas": metadatas, + } + ) + + def _result_to_search_result(self, result) -> SearchResult: print(result) ids = [] @@ -105,7 +134,7 @@ class MilvusClient: output_fields=["data", "metadata"], ) - return self._result_to_query_result(result) + return self._result_to_search_result(result) def get(self, collection_name: str) -> Optional[GetResult]: # Get all the items in the collection. @@ -113,7 +142,7 @@ class MilvusClient: collection_name=f"{self.collection_prefix}_{collection_name}", filter='id != ""', ) - return GetResult(**self._result_to_query_result(result)) + return self._result_to_get_result([result]) def insert(self, collection_name: str, items: list[VectorItem]): # Insert the items into the collection, if the collection does not exist, it will be created. From a7ea07036ed77058c7f6a1d97be926b89f1d9dc6 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:12:00 +0200 Subject: [PATCH 051/143] fix: if cuda is not available fallback to cpu --- backend/open_webui/__init__.py | 12 ++++++++++++ backend/open_webui/env.py | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index 30e83b198..743656d9e 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -39,6 +39,18 @@ def serve( "/usr/local/lib/python3.11/site-packages/nvidia/cudnn/lib", ] ) + try: + import torch + assert torch.cuda.is_available(), "CUDA not available" + typer.echo("CUDA seems to be working") + except Exception as e: + typer.echo( + "Error when testing CUDA but USE_CUDA_DOCKER is true. " + "Resetting USE_CUDA_DOCKER to false and removing " + f"LD_LIBRARY_PATH modifications: {e}" + ) + os.environ["USE_CUDA_DOCKER"] = "false" + os.environ["LD_LIBRARY_PATH"] = ":".join(LD_LIBRARY_PATH) import open_webui.main # we need set environment variables before importing main uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*") diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index d99a80df4..df5597cbf 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -36,7 +36,18 @@ except ImportError: USE_CUDA = os.environ.get("USE_CUDA_DOCKER", "false") if USE_CUDA.lower() == "true": - DEVICE_TYPE = "cuda" + try: + import torch + assert torch.cuda.is_available(), "CUDA not available" + DEVICE_TYPE = "cuda" + except Exception as e: + cuda_error = ( + "Error when testing CUDA but USE_CUDA_DOCKER is true. " + f"Resetting USE_CUDA_DOCKER to false: {e}" + ) + os.environ["USE_CUDA_DOCKER"] = "false" + USE_CUDA = "false" + DEVICE_TYPE = "cpu" else: DEVICE_TYPE = "cpu" @@ -56,6 +67,9 @@ else: log = logging.getLogger(__name__) log.info(f"GLOBAL_LOG_LEVEL: {GLOBAL_LOG_LEVEL}") +if "cuda_error" in locals(): + log.exception(cuda_error) + log_sources = [ "AUDIO", "COMFYUI", From 82b35492afee3f0e004301facd7252e7b0f4bdcd Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:18:44 +0200 Subject: [PATCH 052/143] pep8 --- backend/open_webui/__init__.py | 1 + backend/open_webui/env.py | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index 743656d9e..167f0fb60 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -41,6 +41,7 @@ def serve( ) try: import torch + assert torch.cuda.is_available(), "CUDA not available" typer.echo("CUDA seems to be working") except Exception as e: diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index df5597cbf..cf45e725c 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -38,6 +38,7 @@ USE_CUDA = os.environ.get("USE_CUDA_DOCKER", "false") if USE_CUDA.lower() == "true": try: import torch + assert torch.cuda.is_available(), "CUDA not available" DEVICE_TYPE = "cuda" except Exception as e: From d46f652f7e35899a2301bde6b5d9325c362b9ffa Mon Sep 17 00:00:00 2001 From: Peter De-Ath Date: Fri, 13 Sep 2024 20:38:30 +0100 Subject: [PATCH 053/143] enh: show page number in citation if known --- src/lib/components/chat/Messages/CitationsModal.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/chat/Messages/CitationsModal.svelte b/src/lib/components/chat/Messages/CitationsModal.svelte index e8d63e080..ecd1088a9 100644 --- a/src/lib/components/chat/Messages/CitationsModal.svelte +++ b/src/lib/components/chat/Messages/CitationsModal.svelte @@ -66,6 +66,7 @@ > {document?.metadata?.name ?? document.source.name} + {document?.metadata?.page ? `(page ${document.metadata.page + 1})` : ''}
{:else}
From bc06e7a28263c89adb8b4cf2f5189fb29ada1694 Mon Sep 17 00:00:00 2001 From: Karl Lee <61072264+KarlLee830@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:10:15 +0800 Subject: [PATCH 054/143] i18n: Update Chinese translation --- src/lib/i18n/locales/zh-CN/translation.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/i18n/locales/zh-CN/translation.json b/src/lib/i18n/locales/zh-CN/translation.json index 0730638e8..27c340b25 100644 --- a/src/lib/i18n/locales/zh-CN/translation.json +++ b/src/lib/i18n/locales/zh-CN/translation.json @@ -236,9 +236,9 @@ "Ensure your CSV file includes 4 columns in this order: Name, Email, Password, Role.": "确保您的 CSV 文件按以下顺序包含 4 列: 姓名、电子邮箱、密码、角色。", "Enter {{role}} message here": "在此处输入 {{role}} 消息", "Enter a detail about yourself for your LLMs to recall": "输入一个关于你自己的详细信息,方便你的大语言模型记住这些内容", - "Enter api auth string (e.g. username:password)": "输入api鉴权路径 (例如:username:password)", + "Enter api auth string (e.g. username:password)": "输入 api 鉴权路径 (例如:username:password)", "Enter Brave Search API Key": "输入 Brave Search API 密钥", - "Enter CFG Scale (e.g. 7.0)": "", + "Enter CFG Scale (e.g. 7.0)": "输入 CFG Scale (例如:7.0)", "Enter Chunk Overlap": "输入块重叠 (Chunk Overlap)", "Enter Chunk Size": "输入块大小 (Chunk Size)", "Enter Github Raw URL": "输入 Github Raw 地址", @@ -249,8 +249,8 @@ "Enter Model ID": "输入模型 ID", "Enter model tag (e.g. {{modelTag}})": "输入模型标签 (例如:{{modelTag}})", "Enter Number of Steps (e.g. 50)": "输入步骤数 (Steps) (例如:50)", - "Enter Sampler (e.g. Euler a)": "", - "Enter Scheduler (e.g. Karras)": "", + "Enter Sampler (e.g. Euler a)": "输入 Sampler (例如:Euler a)", + "Enter Scheduler (e.g. Karras)": "输入 Scheduler (例如:Karras)", "Enter Score": "输入评分", "Enter SearchApi API Key": "输入 SearchApi API 密钥", "Enter SearchApi Engine": "输入 SearchApi 引擎", @@ -576,13 +576,13 @@ "Serpstack API Key": "Serpstack API 密钥", "Server connection verified": "已验证服务器连接", "Set as default": "设为默认", - "Set CFG Scale": "", + "Set CFG Scale": "设置 CFG Scale", "Set Default Model": "设置默认模型", "Set embedding model (e.g. {{model}})": "设置语义向量模型 (例如:{{model}})", "Set Image Size": "设置图片分辨率", "Set reranking model (e.g. {{model}})": "设置重排模型 (例如:{{model}})", - "Set Sampler": "", - "Set Scheduler": "", + "Set Sampler": "设置 Sampler", + "Set Scheduler": "设置 Scheduler", "Set Steps": "设置步骤", "Set Task Model": "设置任务模型", "Set Voice": "设置音色", From 3199e265005f8587c62581012f9c371c3137a621 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Sat, 14 Sep 2024 12:44:51 +0100 Subject: [PATCH 055/143] fix: remove unsupported .doc file ingest --- backend/open_webui/apps/rag/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index a0d4c7d28..6d51eabc7 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/backend/open_webui/apps/rag/main.py @@ -1155,7 +1155,7 @@ def get_loader(filename: str, file_content_type: str, file_path: str): elif ( file_content_type == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" - or file_ext in ["doc", "docx"] + or file_ext == "docx" ): loader = Docx2txtLoader(file_path) elif file_content_type in [ From d00d3341af31d3e8097ad94613bbf0c4f8526baa Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 14 Sep 2024 20:32:04 +0200 Subject: [PATCH 056/143] Update translation.json --- src/lib/i18n/locales/uk-UA/translation.json | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib/i18n/locales/uk-UA/translation.json b/src/lib/i18n/locales/uk-UA/translation.json index 5880887ed..781468c7f 100644 --- a/src/lib/i18n/locales/uk-UA/translation.json +++ b/src/lib/i18n/locales/uk-UA/translation.json @@ -230,7 +230,7 @@ "Enable Message Rating": "Увімкнути оцінку повідомлень", "Enable New Sign Ups": "Дозволити нові реєстрації", "Enable Web Search": "Увімкнути веб-пошук", - "Enable Web Search Query Generation": "", + "Enable Web Search Query Generation": "Увімкнути генерацію запитів для веб-пошуку", "Enabled": "Увімкнено", "Engine": "Рушій", "Ensure your CSV file includes 4 columns in this order: Name, Email, Password, Role.": "Переконайтеся, що ваш CSV-файл містить 4 колонки в такому порядку: Ім'я, Email, Пароль, Роль.", @@ -238,7 +238,7 @@ "Enter a detail about yourself for your LLMs to recall": "Введіть відомості про себе для запам'ятовування вашими LLM.", "Enter api auth string (e.g. username:password)": "Введіть рядок авторизації api (напр, ім'я користувача:пароль)", "Enter Brave Search API Key": "Введіть ключ API для пошуку Brave", - "Enter CFG Scale (e.g. 7.0)": "", + "Enter CFG Scale (e.g. 7.0)": "Введіть масштаб CFG (напр., 7.0)", "Enter Chunk Overlap": "Введіть перекриття фрагменту", "Enter Chunk Size": "Введіть розмір фрагменту", "Enter Github Raw URL": "Введіть Raw URL-адресу Github", @@ -249,11 +249,11 @@ "Enter Model ID": "Введіть ID моделі", "Enter model tag (e.g. {{modelTag}})": "Введіть тег моделі (напр., {{modelTag}})", "Enter Number of Steps (e.g. 50)": "Введіть кількість кроків (напр., 50)", - "Enter Sampler (e.g. Euler a)": "", - "Enter Scheduler (e.g. Karras)": "", + "Enter Sampler (e.g. Euler a)": "Введіть семплер (напр., Euler a)", + "Enter Scheduler (e.g. Karras)": "Введіть планувальник (напр., Karras)", "Enter Score": "Введіть бал", - "Enter SearchApi API Key": "", - "Enter SearchApi Engine": "", + "Enter SearchApi API Key": "Введіть ключ API для SearchApi", + "Enter SearchApi Engine": "Введіть SearchApi рушія", "Enter Searxng Query URL": "Введіть URL-адресу запиту Searxng", "Enter Serper API Key": "Введіть ключ API Serper", "Enter Serply API Key": "Введіть ключ API Serply", @@ -276,7 +276,7 @@ "Export All Chats (All Users)": "Експортувати всі чати (всіх користувачів)", "Export chat (.json)": "Експорт чату (.json)", "Export Chats": "Експортувати чати", - "Export Config to JSON File": "", + "Export Config to JSON File": "Експортувати конфігурацію у файл JSON", "Export Documents Mapping": "Експортувати відображення документів", "Export Functions": "Експорт функцій ", "Export LiteLLM config.yaml": "Експорт LiteLLM config.yaml", @@ -341,7 +341,7 @@ "Image Settings": "Налаштування зображення", "Images": "Зображення", "Import Chats": "Імпортувати чати", - "Import Config from JSON File": "", + "Import Config from JSON File": "Імпортувати конфігурацію з файлу JSON", "Import Documents Mapping": "Імпортувати відображення документів", "Import Functions": "Імпорт функцій ", "Import Models": "Імпорт моделей", @@ -371,7 +371,7 @@ "Last Active": "Остання активність", "Last Modified": "Востаннє змінено", "Leave empty for unlimited": "Залиште порожнім для необмеженого розміру", - "Leave empty to use the default prompt, or enter a custom prompt": "", + "Leave empty to use the default prompt, or enter a custom prompt": "Залиште порожнім для використання стандартного запиту, або введіть власний запит", "Light": "Світла", "Listening...": "Слухаю...", "LLMs can make mistakes. Verify important information.": "LLMs можуть помилятися. Перевірте важливу інформацію.", @@ -545,8 +545,8 @@ "Search Query Generation Prompt": "Підказка для формування пошукового промту", "Search Result Count": "Кількість результатів пошуку", "Search Tools": "Пошуку інструментів", - "SearchApi API Key": "", - "SearchApi Engine": "", + "SearchApi API Key": "Ключ API для SearchApi", + "SearchApi Engine": "Рушій SearchApi", "Searched {{count}} sites_one": "Переглянуто {{count}} сайт", "Searched {{count}} sites_few": "Переглянуто {{count}} сайти", "Searched {{count}} sites_many": "Переглянуто {{count}} сайтів", @@ -579,13 +579,13 @@ "Serpstack API Key": "Ключ API Serpstack", "Server connection verified": "З'єднання з сервером підтверджено", "Set as default": "Встановити за замовчуванням", - "Set CFG Scale": "", + "Set CFG Scale": "Встановити масштаб CFG", "Set Default Model": "Встановити модель за замовчуванням", "Set embedding model (e.g. {{model}})": "Встановити модель вбудовування (напр, {{model}})", "Set Image Size": "Встановити розмір зображення", "Set reranking model (e.g. {{model}})": "Встановити модель переранжування (напр., {{model}})", - "Set Sampler": "", - "Set Scheduler": "", + "Set Sampler": "Встановити семплер", + "Set Scheduler": "Встановити планувальник", "Set Steps": "Встановити кроки", "Set Task Model": "Встановити модель задач", "Set Voice": "Встановити голос", From 869063c74352cc73c0e5b36adc1f44da5a9dd434 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 14 Sep 2024 20:58:42 +0100 Subject: [PATCH 057/143] refac: better reranking model error handling --- backend/open_webui/apps/rag/main.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index a0d4c7d28..31bfe49a8 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/backend/open_webui/apps/rag/main.py @@ -195,11 +195,16 @@ def update_reranking_model( if reranking_model: import sentence_transformers - app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder( - get_model_path(reranking_model, update_model), - device=DEVICE_TYPE, - trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE, - ) + try: + app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder( + get_model_path(reranking_model, update_model), + device=DEVICE_TYPE, + trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE, + ) + except: + log.error("CrossEncoder error") + app.state.sentence_transformer_rf = None + app.state.config.ENABLE_RAG_HYBRID_SEARCH = False else: app.state.sentence_transformer_rf = None From d0df2cbe53e5a00a422c10cb4b6830aed4eb94e1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 14 Sep 2024 23:13:52 +0100 Subject: [PATCH 058/143] fix: disable "enable new sign ups" not working issue --- backend/open_webui/apps/webui/routers/auths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/webui/routers/auths.py b/backend/open_webui/apps/webui/routers/auths.py index 2366841e1..bfa460836 100644 --- a/backend/open_webui/apps/webui/routers/auths.py +++ b/backend/open_webui/apps/webui/routers/auths.py @@ -190,8 +190,8 @@ async def signin(request: Request, response: Response, form_data: SigninForm): async def signup(request: Request, response: Response, form_data: SignupForm): if ( not request.app.state.config.ENABLE_SIGNUP - and request.app.state.config.ENABLE_LOGIN_FORM - and WEBUI_AUTH + or not request.app.state.config.ENABLE_LOGIN_FORM + or not WEBUI_AUTH ): raise HTTPException( status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED From fa8d7bd9c69434c8b2ba3e87c5c321b2851209a9 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 14 Sep 2024 23:17:58 +0100 Subject: [PATCH 059/143] enh: allow new lines in default prompts --- src/lib/components/admin/Settings/Interface.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/admin/Settings/Interface.svelte b/src/lib/components/admin/Settings/Interface.svelte index 295f3d208..4ccdc80de 100644 --- a/src/lib/components/admin/Settings/Interface.svelte +++ b/src/lib/components/admin/Settings/Interface.svelte @@ -307,9 +307,10 @@ />
-
From 902f30c123b75f435378f7007fb906598de76065 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 14 Sep 2024 23:23:52 +0100 Subject: [PATCH 060/143] enh: table view allow overflow --- .../Messages/Markdown/MarkdownTokens.svelte | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte b/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte index b01e249ec..33538c9af 100644 --- a/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte +++ b/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte @@ -34,34 +34,36 @@ code={revertSanitizedResponseContent(token?.text ?? '')} /> {:else if token.type === 'table'} - - - - {#each token.header as header, headerIdx} - - {/each} - - - - {#each token.rows as row, rowIdx} +
+
- -
+ - {#each row ?? [] as cell, cellIdx} - {/each} - {/each} - -
+ {#each token.header as header, headerIdx} + - +
+ + + {#each token.rows as row, rowIdx} + + {#each row ?? [] as cell, cellIdx} + + + + {/each} + + {/each} + + +
{:else if token.type === 'blockquote'}
From 5dd6ae6ec4d0ec97e2bf0e838d8dfe820630d5dc Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 14 Sep 2024 23:30:56 +0100 Subject: [PATCH 061/143] chore: npm --- package-lock.json | 117 ++++++++++++++++++++++++++++++++++------------ package.json | 2 +- 2 files changed, 87 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ec44ffa7..dc644722c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@codemirror/theme-one-dark": "^6.1.2", "@pyscript/core": "^0.4.32", "@sveltejs/adapter-node": "^2.0.0", + "@xyflow/svelte": "^0.1.19", "async": "^3.2.5", "bits-ui": "^0.19.7", "codemirror": "^6.0.1", @@ -45,7 +46,6 @@ "@sveltejs/kit": "^2.5.20", "@sveltejs/vite-plugin-svelte": "^3.1.1", "@tailwindcss/typography": "^0.5.13", - "@types/bun": "latest", "@typescript-eslint/eslint-plugin": "^6.17.0", "@typescript-eslint/parser": "^6.17.0", "autoprefixer": "^10.4.16", @@ -1368,6 +1368,14 @@ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" }, + "node_modules/@svelte-put/shortcut": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@svelte-put/shortcut/-/shortcut-3.1.1.tgz", + "integrity": "sha512-2L5EYTZXiaKvbEelVkg5znxqvfZGZai3m97+cAiUBhLZwXnGtviTDpHxOoZBsqz41szlfRMcamW/8o0+fbW3ZQ==", + "peerDependencies": { + "svelte": "^3.55.0 || ^4.0.0 || ^5.0.0" + } + }, "node_modules/@sveltejs/adapter-auto": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@sveltejs/adapter-auto/-/adapter-auto-3.2.2.tgz", @@ -1494,20 +1502,32 @@ "tailwindcss": ">=3.0.0 || insiders" } }, - "node_modules/@types/bun": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.0.10.tgz", - "integrity": "sha512-Jaz6YYAdm1u3NVlgSyEK+qGmrlLQ20sbWeEoXD64b9w6z/YKYNWlfaphu+xF2Kiy5Tpykm5Q9jIquLegwXx4ng==", - "dev": true, - "dependencies": { - "bun-types": "1.0.33" - } - }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "dependencies": { + "@types/d3-color": "*" + } + }, "node_modules/@types/d3-scale": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.8.tgz", @@ -1521,11 +1541,33 @@ "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.0.3.tgz", "integrity": "sha512-laXM4+1o5ImZv3RpFAsTRn3TEkzqkytiOY0Dz0sq5cnd1dtNlk6sHLon4OvqaiJb28T0S/TdsBI3Sjsy+keJrw==" }, + "node_modules/@types/d3-selection": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.10.tgz", + "integrity": "sha512-cuHoUgS/V3hLdjJOLTT691+G2QoqAjCVLmr4kJXR4ha56w1Zdu8UUQ5TxLRqudgNjwXeQxKMq4j+lyf9sWuslg==" + }, "node_modules/@types/d3-time": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz", "integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==" }, + "node_modules/@types/d3-transition": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.8.tgz", + "integrity": "sha512-ew63aJfQ/ms7QQ4X7pk5NxQ9fZH/z+i24ZfJ6tJSfqxJMrYLiK01EAs2/Rtw/JreGUsS3pLPNV644qXFGnoZNQ==", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz", + "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -1568,7 +1610,7 @@ "version": "20.11.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", - "devOptional": true, + "optional": true, "dependencies": { "undici-types": "~5.26.4" } @@ -1613,15 +1655,6 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", @@ -1942,6 +1975,33 @@ "resolved": "https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.5.tgz", "integrity": "sha512-zCcqCJoNLvdeF41asAK71XPlwSPieeRDsE09albBunJEksuYPYNillKNQjf8p5BqSoTKTuKrW3lUm3MNodUC4g==" }, + "node_modules/@xyflow/svelte": { + "version": "0.1.19", + "resolved": "https://registry.npmjs.org/@xyflow/svelte/-/svelte-0.1.19.tgz", + "integrity": "sha512-yW5w5aI+Yqkob4kLQpVDo/ZmX+E9Pw7459kqwLfv4YG4N1NYXrsDRh9cyph/rapbuDnPi6zqK5E8LKrgaCQC0w==", + "dependencies": { + "@svelte-put/shortcut": "^3.1.0", + "@xyflow/system": "0.0.42", + "classcat": "^5.0.4" + }, + "peerDependencies": { + "svelte": "^3.0.0 || ^4.0.0" + } + }, + "node_modules/@xyflow/system": { + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@xyflow/system/-/system-0.0.42.tgz", + "integrity": "sha512-kWYj+Y0GOct0jKYTdyRMNOLPxGNbb2TYvPg2gTmJnZ31DOOMkL5uRBLX825DR2gOACDu+i5FHLxPJUPf/eGOJw==", + "dependencies": { + "@types/d3-drag": "^3.0.7", + "@types/d3-selection": "^3.0.10", + "@types/d3-transition": "^3.0.8", + "@types/d3-zoom": "^3.0.8", + "d3-drag": "^3.0.0", + "d3-selection": "^3.0.0", + "d3-zoom": "^3.0.0" + } + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -2533,16 +2593,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/bun-types": { - "version": "1.0.33", - "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.0.33.tgz", - "integrity": "sha512-L5tBIf9g6rBBkvshqysi5NoLQ9NnhSPU1pfJ9FzqoSfofYdyac3WLUnOIuQ+M5za/sooVUOP2ko+E6Tco0OLIA==", - "dev": true, - "dependencies": { - "@types/node": "~20.11.3", - "@types/ws": "~8.5.10" - } - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -2777,6 +2827,11 @@ "node": ">=8" } }, + "node_modules/classcat": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/classcat/-/classcat-5.0.5.tgz", + "integrity": "sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==" + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -9112,7 +9167,7 @@ "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true + "optional": true }, "node_modules/unist-util-stringify-position": { "version": "3.0.3", diff --git a/package.json b/package.json index 08c101384..5aaf90a71 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "@sveltejs/kit": "^2.5.20", "@sveltejs/vite-plugin-svelte": "^3.1.1", "@tailwindcss/typography": "^0.5.13", - "@types/bun": "latest", "@typescript-eslint/eslint-plugin": "^6.17.0", "@typescript-eslint/parser": "^6.17.0", "autoprefixer": "^10.4.16", @@ -54,6 +53,7 @@ "@codemirror/theme-one-dark": "^6.1.2", "@pyscript/core": "^0.4.32", "@sveltejs/adapter-node": "^2.0.0", + "@xyflow/svelte": "^0.1.19", "async": "^3.2.5", "bits-ui": "^0.19.7", "codemirror": "^6.0.1", From 253791b92cdfe1267ffc38e084711763fd19d765 Mon Sep 17 00:00:00 2001 From: Khanh Le Date: Sun, 15 Sep 2024 16:43:42 +0700 Subject: [PATCH 062/143] save model icon as png --- src/lib/components/workspace/Models.svelte | 2 +- src/routes/(app)/workspace/models/create/+page.svelte | 6 +++--- src/routes/(app)/workspace/models/edit/+page.svelte | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/components/workspace/Models.svelte b/src/lib/components/workspace/Models.svelte index 18635b8d9..d7a922c91 100644 --- a/src/lib/components/workspace/Models.svelte +++ b/src/lib/components/workspace/Models.svelte @@ -322,7 +322,7 @@ >
diff --git a/src/routes/(app)/workspace/models/create/+page.svelte b/src/routes/(app)/workspace/models/create/+page.svelte index b47d37bf3..dd40bf50d 100644 --- a/src/routes/(app)/workspace/models/create/+page.svelte +++ b/src/routes/(app)/workspace/models/create/+page.svelte @@ -309,7 +309,7 @@ ctx.drawImage(img, offsetX, offsetY, newWidth, newHeight); // Get the base64 representation of the compressed image - const compressedSrc = canvas.toDataURL('image/jpeg'); + const compressedSrc = canvas.toDataURL(); // Display the compressed image info.meta.profile_image_url = compressedSrc; @@ -321,7 +321,7 @@ if ( inputFiles && inputFiles.length > 0 && - ['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type']) + ['image/gif', 'image/webp', 'image/jpeg', 'image/png', 'image/svg+xml'].includes(inputFiles[0]['type']) ) { reader.readAsDataURL(inputFiles[0]); } else { @@ -366,7 +366,7 @@
-
-
{$i18n.t('Capabilities')}
-
-
- {#each Object.keys(capabilities) as capability} -
- { - capabilities[capability] = e.detail === 'checked'; - }} - /> - -
- {$i18n.t(capability)} -
-
- {/each} -
+
diff --git a/src/routes/(app)/workspace/models/edit/+page.svelte b/src/routes/(app)/workspace/models/edit/+page.svelte index 22cd4ffd9..08cb853ac 100644 --- a/src/routes/(app)/workspace/models/edit/+page.svelte +++ b/src/routes/(app)/workspace/models/edit/+page.svelte @@ -18,6 +18,7 @@ import ToolsSelector from '$lib/components/workspace/Models/ToolsSelector.svelte'; import FiltersSelector from '$lib/components/workspace/Models/FiltersSelector.svelte'; import ActionsSelector from '$lib/components/workspace/Models/ActionsSelector.svelte'; + import Capabilities from '$lib/components/workspace/Models/Capabilities.svelte'; const i18n = getContext('i18n'); @@ -577,25 +578,7 @@
-
-
{$i18n.t('Capabilities')}
-
-
- {#each Object.keys(capabilities) as capability} -
- { - capabilities[capability] = e.detail === 'checked'; - }} - /> - -
- {$i18n.t(capability)} -
-
- {/each} -
+
From db0c576f48547b7134c9b06dca2960660d13a5d6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 16 Sep 2024 07:14:17 +0200 Subject: [PATCH 064/143] refac --- backend/open_webui/apps/webui/routers/memories.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/apps/webui/routers/memories.py b/backend/open_webui/apps/webui/routers/memories.py index 4680f27ab..d659833bc 100644 --- a/backend/open_webui/apps/webui/routers/memories.py +++ b/backend/open_webui/apps/webui/routers/memories.py @@ -81,7 +81,7 @@ async def query_memory( request: Request, form_data: QueryMemoryForm, user=Depends(get_verified_user) ): results = VECTOR_DB_CLIENT.search( - name=f"user-memory-{user.id}", + collection_name=f"user-memory-{user.id}", vectors=[request.app.state.EMBEDDING_FUNCTION(form_data.content)], limit=form_data.k, ) From b38986a0aa75e914d86b59e8bea817d3db4a93fa Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 16 Sep 2024 11:46:39 +0200 Subject: [PATCH 065/143] enh: colbert rerank support --- backend/open_webui/apps/rag/main.py | 85 ++++++++++++++++++++++++---- backend/open_webui/apps/rag/utils.py | 3 +- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index c605b7211..2acb4fde9 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/backend/open_webui/apps/rag/main.py @@ -10,6 +10,9 @@ from datetime import datetime from pathlib import Path from typing import Iterator, Optional, Sequence, Union + +import numpy as np +import torch import requests import validators @@ -114,6 +117,8 @@ from langchain_community.document_loaders import ( YoutubeLoader, ) from langchain_core.documents import Document +from colbert.infra import ColBERTConfig +from colbert.modeling.checkpoint import Checkpoint log = logging.getLogger(__name__) log.setLevel(SRC_LOG_LEVELS["RAG"]) @@ -193,18 +198,76 @@ def update_reranking_model( update_model: bool = False, ): if reranking_model: - import sentence_transformers + if reranking_model in ["jinaai/jina-colbert-v2"]: - try: - app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder( - get_model_path(reranking_model, update_model), - device=DEVICE_TYPE, - trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE, - ) - except: - log.error("CrossEncoder error") - app.state.sentence_transformer_rf = None - app.state.config.ENABLE_RAG_HYBRID_SEARCH = False + class Colbert: + def __init__(self, name) -> None: + self.ckpt = Checkpoint(name, colbert_config=ColBERTConfig()) + pass + + def calculate_similarity_scores(query_embeddings, document_embeddings): + # Validate dimensions to ensure compatibility + if query_embeddings.dim() != 3: + raise ValueError( + f"Expected query embeddings to have 3 dimensions, but got {query_embeddings.dim()}." + ) + if document_embeddings.dim() != 3: + raise ValueError( + f"Expected document embeddings to have 3 dimensions, but got {document_embeddings.dim()}." + ) + if query_embeddings.size(0) not in [1, document_embeddings.size(0)]: + raise ValueError( + "There should be either one query or queries equal to the number of documents." + ) + + # Transpose the query embeddings to align for matrix multiplication + transposed_query_embeddings = query_embeddings.permute(0, 2, 1) + # Compute similarity scores using batch matrix multiplication + computed_scores = torch.matmul( + document_embeddings, transposed_query_embeddings + ) + # Apply max pooling to extract the highest semantic similarity across each document's sequence + maximum_scores = torch.max(computed_scores, dim=1).values + + # Sum up the maximum scores across features to get the overall document relevance scores + final_scores = maximum_scores.sum(dim=1) + + normalized_scores = torch.softmax(final_scores, dim=0) + + return normalized_scores.numpy().astype(np.float32) + + def predict(self, sentences): + + query = sentences[0][0] + docs = [i[1] for i in sentences] + + # Embedding the documents + embedded_docs = self.ckpt.docFromText(docs, bsize=32)[0] + # Embedding the queries + embedded_queries = self.ckpt.queryFromText([query], bsize=32) + embedded_query = embedded_queries[0] + + # Calculate retrieval scores for the query against all documents + scores = self.calculate_similarity_scores( + embedded_query.unsqueeze(0), embedded_docs + ) + + return scores + + app.state.sentence_transformer_rf = Colbert(reranking_model) + else: + import sentence_transformers + + try: + app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder( + get_model_path(reranking_model, update_model), + device=DEVICE_TYPE, + trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE, + ) + except: + log.error("CrossEncoder error") + app.state.sentence_transformer_rf = None + app.state.config.ENABLE_RAG_HYBRID_SEARCH = False else: app.state.sentence_transformer_rf = None diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index bdec5f9da..7c0d02984 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -232,8 +232,7 @@ def query_collection_with_hybrid_search( if error: raise Exception( - "Hybrid search failed for all collections. Using " - "Non hybrid search as fallback." + "Hybrid search failed for all collections. Using Non hybrid search as fallback." ) return merge_and_sort_query_results(results, k=k, reverse=True) From cb9e76c7f96593f0a81c46c6e2fee8eb60fa9395 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 16 Sep 2024 12:01:04 +0200 Subject: [PATCH 066/143] refac: default rag template --- backend/open_webui/apps/rag/main.py | 3 ++- .../components/admin/Settings/Documents.svelte | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index 2acb4fde9..f801d7423 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/backend/open_webui/apps/rag/main.py @@ -69,6 +69,7 @@ from open_webui.config import ( RAG_RERANKING_MODEL, RAG_RERANKING_MODEL_AUTO_UPDATE, RAG_RERANKING_MODEL_TRUST_REMOTE_CODE, + DEFAULT_RAG_TEMPLATE, RAG_TEMPLATE, RAG_TOP_K, RAG_WEB_SEARCH_CONCURRENT_REQUESTS, @@ -660,7 +661,7 @@ async def update_query_settings( form_data: QuerySettingsForm, user=Depends(get_admin_user) ): app.state.config.RAG_TEMPLATE = ( - form_data.template if form_data.template else RAG_TEMPLATE + form_data.template if form_data.template != "" else DEFAULT_RAG_TEMPLATE ) app.state.config.TOP_K = form_data.k if form_data.k else 4 app.state.config.RELEVANCE_THRESHOLD = form_data.r if form_data.r else 0.0 diff --git a/src/lib/components/admin/Settings/Documents.svelte b/src/lib/components/admin/Settings/Documents.svelte index 7f935a08a..e06edce9d 100644 --- a/src/lib/components/admin/Settings/Documents.svelte +++ b/src/lib/components/admin/Settings/Documents.svelte @@ -732,11 +732,17 @@
{$i18n.t('RAG Template')}
-