fix: distributed_inference always display

This commit is contained in:
jialin
2025-11-04 18:57:57 +08:00
parent 7e5edd6387
commit 80527d5985
2 changed files with 22 additions and 20 deletions
+19 -20
View File
@@ -5,7 +5,7 @@ import { useIntl } from '@umijs/max';
import { Form } from 'antd'; import { Form } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { useCallback } from 'react'; import { useCallback } from 'react';
import { DeployFormKeyMap, modelCategories, ScheduleValueMap } from '../config'; import { DeployFormKeyMap, modelCategories } from '../config';
import { backendOptionsMap } from '../config/backend-parameters'; import { backendOptionsMap } from '../config/backend-parameters';
import { useFormContext } from '../config/form-context'; import { useFormContext } from '../config/form-context';
import { FormData } from '../config/types'; import { FormData } from '../config/types';
@@ -85,25 +85,24 @@ const AdvanceConfig = () => {
></LabelSelector> ></LabelSelector>
</Form.Item> </Form.Item>
{scheduleType === ScheduleValueMap.Auto && {[backendOptionsMap.vllm, backendOptionsMap.ascendMindie].includes(
[backendOptionsMap.vllm, backendOptionsMap.ascendMindie].includes( backend
backend ) && (
) && ( <Form.Item<FormData>
<Form.Item<FormData> name="distributed_inference_across_workers"
name="distributed_inference_across_workers" valuePropName="checked"
valuePropName="checked" style={{ marginBottom: 8 }}
style={{ marginBottom: 8 }} >
> <CheckboxField
<CheckboxField description={intl.formatMessage({
description={intl.formatMessage({ id: 'models.form.distribution.tips'
id: 'models.form.distribution.tips' })}
})} label={intl.formatMessage({
label={intl.formatMessage({ id: 'resources.form.enableDistributedInferenceAcrossWorkers'
id: 'resources.form.enableDistributedInferenceAcrossWorkers' })}
})} ></CheckboxField>
></CheckboxField> </Form.Item>
</Form.Item> )}
)}
<Form.Item<FormData> <Form.Item<FormData>
name="restart_on_error" name="restart_on_error"
valuePropName="checked" valuePropName="checked"
+3
View File
@@ -203,6 +203,9 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
}; };
const handleBackendChange = async (val: string, option: BackendOption) => { const handleBackendChange = async (val: string, option: BackendOption) => {
await new Promise((resolve) => {
setTimeout(resolve, 100);
});
form.setFieldsValue({ form.setFieldsValue({
env: null, env: null,
backend_version: '', // don't set default version here, let the user select it backend_version: '', // don't set default version here, let the user select it