chore: show quant in catalog form

This commit is contained in:
jialin
2025-11-03 10:14:30 +08:00
parent 303429c52c
commit adb5cd72b9
8 changed files with 33 additions and 58 deletions
+2 -1
View File
@@ -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'
};
+3 -2
View File
@@ -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 ==========
+4 -2
View File
@@ -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 ==========
+2 -1
View File
@@ -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': '量化'
};
-2
View File
@@ -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<BasicFormProps> = (props) => {
min={0}
></SealInput.Number>
</Form.Item>
<CatalogFrom></CatalogFrom>
<Form.Item<FormData> name="description">
<SealInput.TextArea
scaleSize={true}
+19 -50
View File
@@ -1,5 +1,6 @@
import SealSelect from '@/components/seal-form/seal-select';
import SealInput from '@/components/seal-form/seal-input';
import useAppUtils from '@/hooks/use-app-utils';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import React from 'react';
import { DeployFormKeyMap } from '../config';
@@ -7,6 +8,7 @@ import { useCatalogFormContext, useFormContext } from '../config/form-context';
import { FormData } from '../config/types';
const CatalogForm: React.FC = () => {
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 && (
<Form.Item<FormData>
name="size"
key="size"
rules={[
{
required: true,
message: getRuleMessage('input', 'size', false)
}
]}
>
<SealSelect
filterOption
onChange={handleSizeChange}
defaultActiveFirstOption
disabled={false}
options={sizeOptions}
label="Size"
required
></SealSelect>
</Form.Item>
)}
{quantizationOptions && quantizationOptions?.length > 0 && (
<Form.Item<FormData>
name="quantization"
key="quantization"
rules={[
{
required: true,
message: getRuleMessage('select', 'quantization', false)
}
]}
>
<SealSelect
filterOption
defaultActiveFirstOption
disabled={false}
options={quantizationOptions}
onChange={handleOnQuantizationChange}
label="Quantization"
required
></SealSelect>
</Form.Item>
)}
<Form.Item<FormData>
name="quantization"
key="quantization"
rules={[
{
required: true,
message: getRuleMessage('select', 'models.form.quantization', false)
}
]}
>
<SealInput.Input
label={intl.formatMessage({ id: 'models.form.quantization' })}
disabled
></SealInput.Input>
</Form.Item>
</>
);
};
+2
View File
@@ -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 = () => {
</SealSelect>
</Form.Item>
)}
<CatalogFrom></CatalogFrom>
<KVCacheForm></KVCacheForm>
<SpeculativeDecode></SpeculativeDecode>
</>
@@ -131,6 +131,7 @@ const SpeculativeDecode = () => {
></AutoComlete>
</Form.Item>
)}
<Form.Item<FormData>
name={['speculative_config', 'num_draft_tokens']}
>