fix: set env null after change backend

This commit is contained in:
jialin
2025-04-11 20:27:30 +08:00
parent f80daf6cd4
commit fb8fcc5028
2 changed files with 8 additions and 9 deletions
+6 -4
View File
@@ -82,9 +82,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
const handleBackendChange = async (val: string) => {
const updates = {
backend_version: '',
backend_parameters: [],
env: {}
backend_version: ''
};
if (val === backendOptionsMap.llamaBox) {
Object.assign(updates, {
@@ -92,7 +90,11 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
cpu_offloading: true
});
}
form.setFieldsValue(updates);
form.setFieldsValue({
...updates,
backend_parameters: [],
env: null
});
handleSetGPUIds(val);
props.onBackendChange?.(val);
};