From de0982d590a8ad5455b84abf2716822c6e860234 Mon Sep 17 00:00:00 2001 From: jialin Date: Sun, 23 Nov 2025 15:07:50 +0800 Subject: [PATCH] fix: compatibility message for gguf --- src/locales/en-US/clusters.ts | 2 +- src/locales/en-US/models.ts | 6 +++-- src/locales/en-US/no-result.ts | 4 ++-- src/locales/ja-JP/clusters.ts | 4 ++-- src/locales/ja-JP/models.ts | 10 +++++--- src/locales/ja-JP/no-result.ts | 4 ++-- src/locales/ru-RU/models.ts | 9 ++++++-- src/locales/zh-CN/clusters.ts | 2 +- src/locales/zh-CN/models.ts | 7 ++++-- src/locales/zh-CN/no-result.ts | 6 ++--- src/pages/backends/index.tsx | 6 +---- .../config/backend-parameters/index.ts | 7 ++++++ src/pages/llmodels/hooks/index.ts | 23 +++++++++++-------- 13 files changed, 55 insertions(+), 35 deletions(-) diff --git a/src/locales/en-US/clusters.ts b/src/locales/en-US/clusters.ts index dcf73277..d5578220 100644 --- a/src/locales/en-US/clusters.ts +++ b/src/locales/en-US/clusters.ts @@ -12,7 +12,7 @@ export default { 'clusters.button.register': 'Register Cluster', 'clusters.button.addNodePool': 'Add Worker Pool', 'clusters.button.add.credential': 'Add {provider} Credential', - 'clusters.credential.title': 'Credential', + 'clusters.credential.title': 'Cloud Credential', 'clusters.credential.token': 'Access Token', 'clusters.workerpool.region': 'Region', 'clusters.workerpool.zone': 'Zone', diff --git a/src/locales/en-US/models.ts b/src/locales/en-US/models.ts index 6f2c8e45..f20c069c 100644 --- a/src/locales/en-US/models.ts +++ b/src/locales/en-US/models.ts @@ -13,7 +13,7 @@ export default { 'models.form.env': 'Environment Variables', 'models.form.configurations': 'Configurations', 'models.form.s3address': 'S3 Address', - 'models.form.partialoffload.tips': `When CPU offloading is enabled, if GPU resources are insufficient, part of the model's layers will be offloaded to the CPU. If no GPU is available, full CPU inference will be used.`, + 'models.form.partialoffload.tips': `When CPU offloading is enabled, GPUStack will allocate CPU memory if GPU resources are insufficient. You must correctly configure the inference backend to use hybrid CPU+GPU or full CPU inference.`, 'models.form.distribution.tips': `Allows for offloading part of the model's layers to single or multiple remote workers when the resources of a worker are insufficient.`, 'models.openinplayground': 'Open in Playground', 'models.instances': 'instances', @@ -119,7 +119,9 @@ export default { 'models.form.moreparameters': 'Parameter Description', 'models.table.vram.allocated': 'Allocated VRAM', 'models.form.backend.warning': - 'The backend for GGUF format models uses llama-box.', + 'The selected backend does not support GGUF models. Please add a backend with GGUF support in the Inference Backend.', + 'models.form.backend.warning.gguf': + 'Please ensure that the selected custom backend supports GGUF models.', 'models.form.ollama.warning': 'Deploy the Ollama model backend using llama-box.', 'models.form.backend.warning.llamabox': diff --git a/src/locales/en-US/no-result.ts b/src/locales/en-US/no-result.ts index 208dfc27..c1e92e65 100644 --- a/src/locales/en-US/no-result.ts +++ b/src/locales/en-US/no-result.ts @@ -22,8 +22,8 @@ export default { 'noresult.cluster.title': 'No Clusters', 'noresult.cluster.subTitle': 'No clusters have been added yet.', 'noresult.cluster.nofound': 'No matching clusters found.', - 'noresult.credentials.title': 'No Credentials', - 'noresult.credentials.subTitle': 'No credentials have been added yet.', + 'noresult.credentials.title': 'No Cloud Credentials', + 'noresult.credentials.subTitle': 'No cloud credentials have been added yet.', 'noresult.credentials.nofound': 'No matching credentials found.', 'noresult.users.title': 'No Users', 'noresult.users.subTitle': 'No users have been added yet.', diff --git a/src/locales/ja-JP/clusters.ts b/src/locales/ja-JP/clusters.ts index 4116963a..bd43e598 100644 --- a/src/locales/ja-JP/clusters.ts +++ b/src/locales/ja-JP/clusters.ts @@ -12,7 +12,7 @@ export default { 'clusters.button.register': 'Register Cluster', 'clusters.button.addNodePool': 'Add Worker Pool', 'clusters.button.add.credential': 'Add {provider} Credential', - 'clusters.credential.title': 'Credential', + 'clusters.credential.title': 'Cloud Credential', 'clusters.credential.token': 'Access Token', 'clusters.workerpool.region': 'Region', 'clusters.workerpool.zone': 'Zone', @@ -107,7 +107,7 @@ Same applies to the /opt/dtk directory.`, // 21. 'clusters.workerpool.volumes': 'Volumes', // 22. 'clusters.workerpool.format': 'Format', // 23. 'clusters.workerpool.size': 'Size (GiB)', -// 24. 'clusters.credential.title': 'Credential', +// 24. 'clusters.credential.title': 'Cloud Credential', // 25. 'clusters.workerpool.title': 'Worker Pools', // 26. 'clusters.workerpool.cloudOptions': 'Add Cloud Options', // 27. 'clusters.workerpool.volumes.add': 'Add Volume' diff --git a/src/locales/ja-JP/models.ts b/src/locales/ja-JP/models.ts index 6ab99fce..3d1a8436 100644 --- a/src/locales/ja-JP/models.ts +++ b/src/locales/ja-JP/models.ts @@ -13,8 +13,7 @@ export default { 'models.form.env': '環境変数', 'models.form.configurations': '設定', 'models.form.s3address': 'S3アドレス', - 'models.form.partialoffload.tips': - 'CPUオフロードが有効な場合、GPUリソースが不足するとモデルの一部のレイヤーがCPUにオフロードされます。GPUが利用できない場合は、完全なCPU推論が使用されます。', + 'models.form.partialoffload.tips': `When CPU offloading is enabled, GPUStack will allocate CPU memory if GPU resources are insufficient. You must correctly configure the inference backend to use hybrid CPU+GPU or full CPU inference.`, 'models.form.distribution.tips': 'ワーカーのリソースが不足している場合、モデルの一部のレイヤーを単一または複数のリモートワーカーにオフロードすることができます。', 'models.openinplayground': 'プレイグラウンドで開く', @@ -121,7 +120,9 @@ export default { 'models.form.moreparameters': 'パラメータ説明', 'models.table.vram.allocated': '割り当て済みVRAM', 'models.form.backend.warning': - 'GGUF形式のモデルのバックエンドはllama-boxを使用します。', + 'The selected backend does not support GGUF models. Please add a backend with GGUF support in the Inference Backend.', + 'models.form.backend.warning.gguf': + 'Please ensure that the selected custom backend supports GGUF models.', 'models.form.ollama.warning': 'Ollamaモデルのバックエンドをllama-boxを使用してデプロイします。', 'models.form.backend.warning.llamabox': @@ -344,4 +345,7 @@ export default { // 62. 'models.form.backend_parameters.vllm.tips': 'For more details about {backend} parameters, see here.', // 63. 'models.button.accessSettings.tips': 'Changes to access settings take effect after one minute.', // 64. 'models.table.userSelection.tips': 'Admin users can access all models by default.', +// 65. 'models.form.partialoffload.tips': `When CPU offloading is enabled, GPUStack will allocate CPU memory if GPU resources are insufficient. You must correctly configure the inference backend to use hybrid CPU+GPU or full CPU inference.`, +// 66. 'models.form.backend.warning': 'The selected backend does not support GGUF models. Please add a backend with GGUF support in the Inference Backend.', +// 67. 'models.form.backend.warning.gguf': 'Please ensure that the selected custom backend supports GGUF models.', // ========== End of To-Do List ========== diff --git a/src/locales/ja-JP/no-result.ts b/src/locales/ja-JP/no-result.ts index 208dfc27..c1e92e65 100644 --- a/src/locales/ja-JP/no-result.ts +++ b/src/locales/ja-JP/no-result.ts @@ -22,8 +22,8 @@ export default { 'noresult.cluster.title': 'No Clusters', 'noresult.cluster.subTitle': 'No clusters have been added yet.', 'noresult.cluster.nofound': 'No matching clusters found.', - 'noresult.credentials.title': 'No Credentials', - 'noresult.credentials.subTitle': 'No credentials have been added yet.', + 'noresult.credentials.title': 'No Cloud Credentials', + 'noresult.credentials.subTitle': 'No cloud credentials have been added yet.', 'noresult.credentials.nofound': 'No matching credentials found.', 'noresult.users.title': 'No Users', 'noresult.users.subTitle': 'No users have been added yet.', diff --git a/src/locales/ru-RU/models.ts b/src/locales/ru-RU/models.ts index 3e5c89ed..50d91f30 100644 --- a/src/locales/ru-RU/models.ts +++ b/src/locales/ru-RU/models.ts @@ -13,7 +13,7 @@ export default { 'models.form.env': 'Переменные окружения', 'models.form.configurations': 'Конфигурации', 'models.form.s3address': 'S3-адрес', - 'models.form.partialoffload.tips': `При включенном оффлоудинге на CPU: если ресурсов GPU недостаточно, часть слоёв модели будет перенесена на CPU. Если GPU отсутствует, будет использоваться полный вывод на CPU.`, // Already translated + 'models.form.partialoffload.tips': `When CPU offloading is enabled, GPUStack will allocate CPU memory if GPU resources are insufficient. You must correctly configure the inference backend to use hybrid CPU+GPU or full CPU inference.`, // Already translated 'models.form.distribution.tips': `Позволяет переносить часть слоёв модели на один или несколько удалённых воркеров, когда ресурсов текущего воркера недостаточно.`, 'models.openinplayground': 'Открыть в Песочнице', 'models.instances': 'инстансы', @@ -120,7 +120,9 @@ export default { 'models.form.moreparameters': 'Описание параметров', 'models.table.vram.allocated': 'Выделенная VRAM', 'models.form.backend.warning': - 'Бэкенд для моделей формата GGUF использует llama-box.', + 'The selected backend does not support GGUF models. Please add a backend with GGUF support in the Inference Backend.', + 'models.form.backend.warning.gguf': + 'Please ensure that the selected custom backend supports GGUF models.', 'models.form.ollama.warning': 'Чтобы развернуть бэкенд для моделей Ollama с использованием llama-box , выполните следующие шаги.', 'models.form.backend.warning.llamabox': @@ -274,4 +276,7 @@ export default { // 9. 'models.button.accessSettings.tips': 'Changes to access settings take effect after one minute.', // 10. 'models.table.userSelection.tips': 'Admin users can access all models by default.', // 11. 'models.form.generic_proxy.tips': 'After enabling the generic proxy, you can access URI paths that do not follow the OpenAI API standard.', +// 12. 'models.form.partialoffload.tips': `When CPU offloading is enabled, GPUStack will allocate CPU memory if GPU resources are insufficient. You must correctly configure the inference backend to use hybrid CPU+GPU or full CPU inference.`, +// 13. 'models.form.backend.warning': 'The selected backend does not support GGUF models. Please add a backend with GGUF support in the Inference Backend.', +// 14. 'models.form.backend.warning.gguf': 'Please ensure that the selected custom backend supports GGUF models.', // ========== End of To-Do List ========== diff --git a/src/locales/zh-CN/clusters.ts b/src/locales/zh-CN/clusters.ts index b092144e..60538173 100644 --- a/src/locales/zh-CN/clusters.ts +++ b/src/locales/zh-CN/clusters.ts @@ -12,7 +12,7 @@ export default { 'clusters.button.register': '注册集群', 'clusters.button.addNodePool': '添加节点池', 'clusters.button.add.credential': '添加 {provider} 凭证', - 'clusters.credential.title': '凭证', + 'clusters.credential.title': '云凭证', 'clusters.credential.token': '访问令牌', 'clusters.workerpool.region': '区域', 'clusters.workerpool.zone': '可用区', diff --git a/src/locales/zh-CN/models.ts b/src/locales/zh-CN/models.ts index c103f386..54a0919f 100644 --- a/src/locales/zh-CN/models.ts +++ b/src/locales/zh-CN/models.ts @@ -14,7 +14,7 @@ export default { 'models.form.configurations': '配置', 'models.form.s3address': 'S3 地址', 'models.form.partialoffload.tips': - '启用 CPU 卸载时,如果 GPU 资源不足,则模型的一部分层将被卸载到 CPU 上,在没有 GPU 可用时,会使用纯 CPU 推理。', + '启用 CPU 卸载后,GPU 不足时 GPUStack 会自动使用 CPU 内存。请确保推理后端已正确配置为混合 CPU+GPU 或纯 CPU 推理。', 'models.form.distribution.tips': '允许在单个节点资源不足时,将部分计算卸载到一个或多个远程节点。', 'models.openinplayground': '在 Playground 中打开', @@ -115,7 +115,10 @@ export default { 'models.form.releases': '版本', 'models.form.moreparameters': '参数说明', 'models.table.vram.allocated': '分配显存', - 'models.form.backend.warning': 'GGUF 格式模型后端用 llama-box。', + 'models.form.backend.warning': + '当前后端不支持 GGUF 格式模型。请在“推理后端”中添加一个支持 GGUF 的后端后再继续。', + 'models.form.backend.warning.gguf': + '请确认当前使用的自定义后端已支持 GGUF 格式模型。', 'models.form.ollama.warning': '部署 Ollama 模型后端使用 llama-box。', 'models.form.backend.warning.llamabox': '要使用 llama-box 后端,请指定模型文件的完整路径(例如:/data/models/model.gguf)。对于分片模型,请提供第一个分片的路径(例如:/data/models/model-00001-of-00004.gguf)。', diff --git a/src/locales/zh-CN/no-result.ts b/src/locales/zh-CN/no-result.ts index 1e69f503..a9870e62 100644 --- a/src/locales/zh-CN/no-result.ts +++ b/src/locales/zh-CN/no-result.ts @@ -22,9 +22,9 @@ export default { 'noresult.cluster.title': '暂无集群', 'noresult.cluster.subTitle': '尚未添加任何集群。', 'noresult.cluster.nofound': '未找到匹配的集群', - 'noresult.credentials.title': '暂无凭证', - 'noresult.credentials.subTitle': '尚未添加任何凭证。', - 'noresult.credentials.nofound': '未找到匹配的凭证', + 'noresult.credentials.title': '暂无云凭证', + 'noresult.credentials.subTitle': '尚未添加任何云凭证。', + 'noresult.credentials.nofound': '未找到匹配的云凭证', 'noresult.users.title': '暂无用户', 'noresult.users.subTitle': '尚未添加任何用户。', 'noresult.users.nofound': '未找到匹配的用户', diff --git a/src/pages/backends/index.tsx b/src/pages/backends/index.tsx index 7ec2257f..62f0d924 100644 --- a/src/pages/backends/index.tsx +++ b/src/pages/backends/index.tsx @@ -37,12 +37,8 @@ const BackendList = () => { modalRef, fetchData, handleDelete, - handleDeleteBatch, - handlePageChange, - handleTableChange, handleSearch, - handleNameChange, - handleQueryChange + handleNameChange } = useTableFetch({ fetchAPI: queryBackendsList, deleteAPI: deleteBackend, diff --git a/src/pages/llmodels/config/backend-parameters/index.ts b/src/pages/llmodels/config/backend-parameters/index.ts index b862a197..b10ec9a6 100644 --- a/src/pages/llmodels/config/backend-parameters/index.ts +++ b/src/pages/llmodels/config/backend-parameters/index.ts @@ -16,6 +16,13 @@ export const backendOptionsMap = { SGLang: 'SGLang' }; +export const BuiltInBackendOptions = [ + backendOptionsMap.vllm, + backendOptionsMap.ascendMindie, + backendOptionsMap.SGLang, + backendOptionsMap.voxBox +]; + export interface BackendParameter { label: string; value: string; diff --git a/src/pages/llmodels/hooks/index.ts b/src/pages/llmodels/hooks/index.ts index 5be8c31c..7b5221b5 100644 --- a/src/pages/llmodels/hooks/index.ts +++ b/src/pages/llmodels/hooks/index.ts @@ -9,7 +9,10 @@ import _ from 'lodash'; import { useEffect, useRef, useState } from 'react'; import { evaluationsModelSpec } from '../apis'; import { modelSourceMap, modelTaskMap } from '../config'; -import { backendOptionsMap } from '../config/backend-parameters'; +import { + backendOptionsMap, + BuiltInBackendOptions +} from '../config/backend-parameters'; import { EvaluateResult, FormData } from '../config/types'; import { generateGPUIds } from '../config/utils'; import useCheckBackend from './use-check-backend'; @@ -334,19 +337,19 @@ export const useCheckCompatibility = () => { const isOllamaModelFile = isBlobFile || isOllamaModel; let warningMessage = ''; - if (isOllamaModelFile && backend === backendOptionsMap.llamaBox) { - warningMessage = ''; - } else if (isOllamaModelFile && backend !== backendOptionsMap.llamaBox) { - warningMessage = intl.formatMessage({ - id: 'models.form.ollama.warning' - }); - } else if (isGGUFFile && backend !== backendOptionsMap.llamaBox) { + if ( + (isGGUFFile || isOllamaModelFile) && + BuiltInBackendOptions.includes(backend) + ) { warningMessage = intl.formatMessage({ id: 'models.form.backend.warning' }); - } else if (!isGGUFFile && backend === backendOptionsMap.llamaBox) { + } else if ( + (isGGUFFile || isOllamaModelFile) && + !BuiltInBackendOptions.includes(backend) + ) { warningMessage = intl.formatMessage({ - id: 'models.form.backend.warning.llamabox' + id: 'models.form.backend.warning.gguf' }); }