From ecbfeb608be66e6551871278ac965d70f0763b9d Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 2 Apr 2025 14:49:13 +0800 Subject: [PATCH] fix: can not select voxbox in editing --- .../components/deploy-builtin-modal.tsx | 6 ++-- .../llmodels/components/update-modal.tsx | 28 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/pages/llmodels/components/deploy-builtin-modal.tsx b/src/pages/llmodels/components/deploy-builtin-modal.tsx index b957c5ad..60704df6 100644 --- a/src/pages/llmodels/components/deploy-builtin-modal.tsx +++ b/src/pages/llmodels/components/deploy-builtin-modal.tsx @@ -373,15 +373,13 @@ const AddModal: React.FC = (props) => { _.toLower(current.name).replace(/\s/g, '-') || '' ); - const allValues = generateSubmitData(defaultSpec); - handleCheckCompatibility(allValues); - if (defaultSpec.backend === backendOptionsMap.llamaBox) { setIsGGUF(true); } else { setIsGGUF(false); } - console.log('values====', form.current.form.getFieldsValue()); + const allValues = generateSubmitData(defaultSpec); + handleCheckCompatibility(allValues); } catch (error) { // ignore } diff --git a/src/pages/llmodels/components/update-modal.tsx b/src/pages/llmodels/components/update-modal.tsx index 6fa88b18..cf6e52c5 100644 --- a/src/pages/llmodels/components/update-modal.tsx +++ b/src/pages/llmodels/components/update-modal.tsx @@ -295,25 +295,24 @@ const UpdateModal: React.FC = (props) => { const handleOk = async (data: FormData) => { const formdata = getSourceRepoConfigValue(data.source, data).values; - let obj = {}; + let submitData = {} as FormData; - if ( - [backendOptionsMap.vllm, backendOptionsMap.voxBox].includes( - formdata.backend - ) - ) { - obj = { - distributed_inference_across_workers: false, - cpu_offloading: false - }; - } + const isVllmOrVoxBox = [ + backendOptionsMap.vllm, + backendOptionsMap.voxBox + ].includes(formdata.backend); submitData = { ..._.omit(formdata, ['scheduleType']), categories: formdata.categories ? [formdata.categories] : [], worker_selector: formdata.scheduleType === 'manual' ? null : formdata.worker_selector, - ...obj, + ...(isVllmOrVoxBox + ? { + distributed_inference_across_workers: false, + cpu_offloading: false + } + : {}), ...generateGPUIds(formdata) }; onOk(submitData); @@ -498,8 +497,9 @@ const UpdateModal: React.FC = (props) => { label: 'vox-box', value: backendOptionsMap.voxBox, disabled: - formData?.source === modelSourceMap.ollama_library_value || - isGGUF + formData?.source === modelSourceMap.local_path_value + ? false + : isGGUF } ]} disabled={