From adb5cd72b9851dcc3afe705440657d86f5c761c9 Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 3 Nov 2025 09:57:29 +0800 Subject: [PATCH] chore: show quant in catalog form --- src/locales/en-US/models.ts | 3 +- src/locales/ja-JP/models.ts | 5 +- src/locales/ru-RU/models.ts | 6 +- src/locales/zh-CN/models.ts | 3 +- src/pages/llmodels/forms/basic.tsx | 2 - src/pages/llmodels/forms/catalog.tsx | 69 +++++-------------- src/pages/llmodels/forms/performance.tsx | 2 + .../llmodels/forms/speculative-decode.tsx | 1 + 8 files changed, 33 insertions(+), 58 deletions(-) diff --git a/src/locales/en-US/models.ts b/src/locales/en-US/models.ts index f1694b22..e22648f7 100644 --- a/src/locales/en-US/models.ts +++ b/src/locales/en-US/models.ts @@ -236,5 +236,6 @@ export default { 'Runs at full (original) precision and prioritizes compatibility.', 'models.form.draftModel.placeholder': 'Please select or enter a draft model', 'models.form.draftModel.tips': - 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.' + 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.', + 'models.form.quantization': 'Quantization' }; diff --git a/src/locales/ja-JP/models.ts b/src/locales/ja-JP/models.ts index e0ed70ce..0d5157ae 100644 --- a/src/locales/ja-JP/models.ts +++ b/src/locales/ja-JP/models.ts @@ -236,7 +236,8 @@ export default { 'the most compatible option with full precision.', 'models.form.draftModel.placeholder': 'Please select or enter a draft model', 'models.form.draftModel.tips': - 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.' + 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.', + 'models.form.quantization': 'Quantization' }; // ========== To-Do: Translate Keys (Remove After Translation) ========== @@ -303,5 +304,5 @@ export default { // 44. 'models.form.mode.baseline.tips': 'the most compatible option with full precision, // 45. 'models.form.draftModel.placeholder': 'Please select or enter a draft model', // 46. 'models.form.draftModel.tips': 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.' - +// 47. 'models.form.quantization': 'Quantization' // ========== End of To-Do List ========== diff --git a/src/locales/ru-RU/models.ts b/src/locales/ru-RU/models.ts index aa86f07e..f343be8c 100644 --- a/src/locales/ru-RU/models.ts +++ b/src/locales/ru-RU/models.ts @@ -236,7 +236,8 @@ export default { 'the most compatible option with full precision.', 'models.form.draftModel.placeholder': 'Please select or enter a draft model', 'models.form.draftModel.tips': - 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.' + 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.', + 'models.form.quantization': 'Quantization' }; // ========== To-Do: Translate Keys (Remove After Translation) ========== @@ -265,5 +266,6 @@ export default { // 35. 'models.form.mode.latency.tips': 'optimized for low latency under low request concurrency.', // 36. 'models.form.mode.baseline.tips': 'the most compatible option with full precision.' // 37. 'models.form.draftModel.placeholder': 'Please select or enter a draft model', -// 38. 'models.form.draftModel.tips': 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.' +// 38. 'models.form.draftModel.tips': 'You can enter a local path (e.g., /path/to/model) or select a model from Hugging Face or ModelScope (e.g., Tengyunw/qwen3_8b_eagle3). The system will automatically match based on the primary model source.', +// 39. 'models.form.quantization': 'Quantization' // ========== End of To-Do List ========== diff --git a/src/locales/zh-CN/models.ts b/src/locales/zh-CN/models.ts index a3636724..7d16e60d 100644 --- a/src/locales/zh-CN/models.ts +++ b/src/locales/zh-CN/models.ts @@ -224,5 +224,6 @@ export default { '以完整(原始)精度运行,并优先保证兼容性。', 'models.form.draftModel.placeholder': '请选择或输入草稿模型', 'models.form.draftModel.tips': - '可填写本地路径(如 /path/to/model),或从 Hugging Face、ModelScope 选择模型(如 Tengyunw/qwen3_8b_eagle3)。系统将根据主模型来源自动匹配。' + '可填写本地路径(如 /path/to/model),或从 Hugging Face、ModelScope 选择模型(如 Tengyunw/qwen3_8b_eagle3)。系统将根据主模型来源自动匹配。', + 'models.form.quantization': '量化' }; diff --git a/src/pages/llmodels/forms/basic.tsx b/src/pages/llmodels/forms/basic.tsx index f17174f5..10e36f84 100644 --- a/src/pages/llmodels/forms/basic.tsx +++ b/src/pages/llmodels/forms/basic.tsx @@ -10,7 +10,6 @@ import { Form } from 'antd'; import { useMemo } from 'react'; import { sourceOptions } from '../config'; import { FormData } from '../config/types'; -import CatalogFrom from './catalog'; import LocalPathSource from './local-path-source'; import OnlineSource from './online-source'; @@ -138,7 +137,6 @@ const BasicForm: React.FC = (props) => { min={0} > - name="description"> { + const intl = useIntl(); const formCtx = useFormContext(); const catalogFormCtx = useCatalogFormContext(); const { getRuleMessage } = useAppUtils(); @@ -18,11 +20,7 @@ const CatalogForm: React.FC = () => { onQuantizationChange } = catalogFormCtx; - if ( - formKey !== DeployFormKeyMap.CATALOG && - !sizeOptions?.length && - !quantizationOptions?.length - ) { + if (formKey !== DeployFormKeyMap.CATALOG) { return null; } @@ -35,50 +33,21 @@ const CatalogForm: React.FC = () => { }; return ( <> - {sizeOptions && sizeOptions?.length > 0 && ( - - name="size" - key="size" - rules={[ - { - required: true, - message: getRuleMessage('input', 'size', false) - } - ]} - > - - - )} - {quantizationOptions && quantizationOptions?.length > 0 && ( - - name="quantization" - key="quantization" - rules={[ - { - required: true, - message: getRuleMessage('select', 'quantization', false) - } - ]} - > - - - )} + + name="quantization" + key="quantization" + rules={[ + { + required: true, + message: getRuleMessage('select', 'models.form.quantization', false) + } + ]} + > + + ); }; diff --git a/src/pages/llmodels/forms/performance.tsx b/src/pages/llmodels/forms/performance.tsx index 39748319..2463700c 100644 --- a/src/pages/llmodels/forms/performance.tsx +++ b/src/pages/llmodels/forms/performance.tsx @@ -5,6 +5,7 @@ import { Form, Select } from 'antd'; import React from 'react'; import { DeployFormKeyMap } from '../config'; import { useCatalogFormContext, useFormContext } from '../config/form-context'; +import CatalogFrom from './catalog'; import KVCacheForm from './kv-cache'; import SpeculativeDecode from './speculative-decode'; @@ -67,6 +68,7 @@ const Performance: React.FC = () => { )} + diff --git a/src/pages/llmodels/forms/speculative-decode.tsx b/src/pages/llmodels/forms/speculative-decode.tsx index 277e926a..6525a58b 100644 --- a/src/pages/llmodels/forms/speculative-decode.tsx +++ b/src/pages/llmodels/forms/speculative-decode.tsx @@ -131,6 +131,7 @@ const SpeculativeDecode = () => { > )} + name={['speculative_config', 'num_draft_tokens']} >