From 7576f08ad5c96b401d9f2284509abf8cc584fa4f Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 18 Dec 2025 10:49:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=E7=A6=81=E7=94=A8ReRank=E6=A8=A1=E5=9E=8BOllama?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ModelEditorDialog.vue | 30 +++++++++++++++++-- frontend/src/i18n/locales/en-US.ts | 1 + frontend/src/i18n/locales/ru-RU.ts | 1 + frontend/src/i18n/locales/zh-CN.ts | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ModelEditorDialog.vue b/frontend/src/components/ModelEditorDialog.vue index 5cde40fb..34ffc6a2 100644 --- a/frontend/src/components/ModelEditorDialog.vue +++ b/frontend/src/components/ModelEditorDialog.vue @@ -25,15 +25,21 @@ {{ $t('model.editor.sourceLocal') }} {{ $t('model.editor.sourceRemote') }} + +
+ + {{ $t('model.editor.ollamaNotSupportRerank') }} +
+ -
+
{{ $t('model.editor.ollamaUnavailable') }} props.visible, (val) => { } else { resetForm() } + + // ReRank 模型强制使用 remote 来源(Ollama 不支持 ReRank) + if (props.modelType === 'rerank') { + formData.value.source = 'remote' + } } else { // 恢复背景滚动 document.body.style.overflow = '' @@ -1314,6 +1325,10 @@ const handleCancel = () => { font-size: 16px; flex-shrink: 0; margin-right: 2px; + + &.info { + color: #07C05F; + } } .tip-text { @@ -1322,6 +1337,17 @@ const handleCancel = () => { line-height: 1.5; } + // ReRank提示使用主题绿色风格,与主页面保持一致 + &.rerank-tip { + background: #f0fdf6; + border: 1px solid #d1fae5; + border-left: 3px solid #07C05F; + + .tip-text { + color: #166534; + } + } + :deep(.tip-link) { color: #07C05F; font-size: 13px; diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index 2b0af527..20a7cf90 100644 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -1407,6 +1407,7 @@ export default { downloadFailed: 'Failed to download {name}', downloadStartFailed: 'Failed to start download', ollamaUnavailable: 'Ollama service is unavailable, local models cannot be selected', + ollamaNotSupportRerank: 'Ollama does not support ReRank models, please use a remote API instead', goToOllamaSettings: 'Open Settings', validation: { modelNameRequired: 'Please enter the model name', diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index 48113c0c..171ba1e3 100644 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -877,6 +877,7 @@ export default { downloadFailed: 'Не удалось загрузить {name}', downloadStartFailed: 'Не удалось запустить загрузку', ollamaUnavailable: 'Сервис Ollama недоступен, локальные модели недоступны для выбора', + ollamaNotSupportRerank: 'Ollama не поддерживает модели ReRank, используйте удалённый API', goToOllamaSettings: 'Открыть настройки', validation: { modelNameRequired: 'Введите название модели', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 0b326b33..2b574291 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -969,6 +969,7 @@ export default { downloadFailed: "{name} 下载失败", downloadStartFailed: "启动下载失败", ollamaUnavailable: "Ollama服务不可用,无法选择本地模型", + ollamaNotSupportRerank: "Ollama 不支持 ReRank 模型,请使用远程接口配置", goToOllamaSettings: "查看设置", validation: { modelNameRequired: "请输入模型名称",