fix: my models status
This commit is contained in:
@@ -3,13 +3,32 @@ 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 { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
|
||||
const KVCacheForm = () => {
|
||||
const intl = useIntl();
|
||||
const form = Form.useFormInstance();
|
||||
const { onValuesChange } = useFormContext();
|
||||
const kvCacheEnabled = Form.useWatch(['extended_kv_cache', 'enabled'], form);
|
||||
|
||||
const handleOnChange = async (e: any) => {
|
||||
if (e.target.checked) {
|
||||
form.setFieldsValue({
|
||||
extended_kv_cache: {
|
||||
enabled: true,
|
||||
chunk_size: 256,
|
||||
max_local_cpu_size: 10,
|
||||
remote_url: ''
|
||||
}
|
||||
});
|
||||
}
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 200);
|
||||
});
|
||||
onValuesChange?.({}, form.getFieldsValue());
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ paddingBottom: 22 }}>
|
||||
@@ -20,6 +39,7 @@ const KVCacheForm = () => {
|
||||
style={{ padding: '0 10px', marginBottom: 0 }}
|
||||
>
|
||||
<CheckboxField
|
||||
onChange={handleOnChange}
|
||||
label={intl.formatMessage({ id: 'models.form.extendedkvcache' })}
|
||||
></CheckboxField>
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user