fix: no backend options from model files

This commit is contained in:
jialin
2025-10-24 10:18:22 +08:00
parent 53b431f100
commit 0401cf5fb9
+9 -13
View File
@@ -447,6 +447,15 @@ const AddModal: FC<AddModalProps> = (props) => {
};
const handleOnOpen = async () => {
const [backendOptions, gpuOptions] = await Promise.all([
form.current?.getBackendOptions?.({
cluster_id: initClusterId()
}),
form.current?.getGPUOptionList?.({
clusterId: initClusterId()
})
]);
if (props.deploymentType === 'modelFiles') {
form.current?.form?.setFieldsValue({
...props.initialValues
@@ -459,14 +468,6 @@ const AddModal: FC<AddModalProps> = (props) => {
source: source
});
} else {
const [backendOptions, gpuOptions] = await Promise.all([
form.current?.getBackendOptions?.({
cluster_id: initClusterId()
}),
form.current?.getGPUOptionList?.({
clusterId: initClusterId()
})
]);
let backend = checkOnlyAscendNPU(gpuOptions)
? backendOptionsMap.ascendMindie
: backendOptionsMap.vllm;
@@ -480,11 +481,6 @@ const AddModal: FC<AddModalProps> = (props) => {
versions: { label: string; value: string }[];
}) => item.value === backend
);
console.log(
'currentDefaultBackend:',
currentDefaultBackend,
props.initialValues
);
form.current?.setFieldsValue?.({
backend,
default_version: currentDefaultBackend?.default_version,