chore: update extended_kv_cache config

This commit is contained in:
jialin
2025-10-31 15:03:23 +08:00
parent f6a3497b0c
commit 2006827968
7 changed files with 74 additions and 36 deletions
+3 -3
View File
@@ -368,9 +368,9 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
distributed_inference_across_workers: true,
extended_kv_cache: {
enabled: false,
chunk_size: 256,
max_local_cpu_size: 10,
remote_url: ''
chunk_size: null,
ram_ratio: 1.2,
ram_size: null
},
...initialValues
}}
+25 -25
View File
@@ -1,6 +1,5 @@
import CheckboxField from '@/components/seal-form/checkbox-field';
import SealInputNumber from '@/components/seal-form/input-number';
import SealInput from '@/components/seal-form/seal-input';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import { useMemo } from 'react';
@@ -21,9 +20,9 @@ const KVCacheForm = () => {
form.setFieldsValue({
extended_kv_cache: {
enabled: true,
chunk_size: extendedKVCache?.chunk_size || 256,
max_local_cpu_size: extendedKVCache?.max_local_cpu_size || 10,
remote_url: extendedKVCache?.remote_url || ''
chunk_size: extendedKVCache?.chunk_size,
ram_ratio: extendedKVCache?.ram_ratio || 1.2,
ram_size: extendedKVCache?.ram_size
}
});
}
@@ -76,11 +75,26 @@ const KVCacheForm = () => {
</div>
{kvCacheEnabled && (
<>
<Form.Item<FormData>
name={['extended_kv_cache', 'max_local_cpu_size']}
>
<Form.Item<FormData> name={['extended_kv_cache', 'ram_ratio']}>
<SealInputNumber
label={intl.formatMessage({ id: 'models.form.maxCPUSize' })}
label={intl.formatMessage({ id: 'models.form.ramRatio' })}
description={intl.formatMessage({
id: 'models.form.ramRatio.tips'
})}
min={0}
step={0.1}
precision={1}
/>
</Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
<SealInputNumber
label={intl.formatMessage({ id: 'models.form.ramSize' })}
description={intl.formatMessage(
{
id: 'models.form.ramSize.tips'
},
{ content: intl.formatMessage({ id: 'models.form.ramRatio' }) }
)}
min={0}
step={1}
precision={0}
@@ -89,27 +103,13 @@ const KVCacheForm = () => {
<Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}>
<SealInputNumber
label={intl.formatMessage({ id: 'models.form.chunkSize' })}
description={intl.formatMessage({
id: 'models.form.chunkSize.tips'
})}
min={0}
step={1}
/>
</Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'remote_url']}>
<SealInput.Input
description={
<span
dangerouslySetInnerHTML={{
__html: intl.formatMessage({
id: 'models.form.remoteURL.tips'
})
}}
></span>
}
label={intl.formatMessage({ id: 'models.form.remoteURL' })}
min={0}
step={1}
placeholder="protocol://host:port"
/>
</Form.Item>
</>
)}
</>