chore: show quant in catalog form
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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']}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user