diff --git a/src/pages/llmodels/components/deploy-modal.tsx b/src/pages/llmodels/components/deploy-modal.tsx index c987b223..63b57043 100644 --- a/src/pages/llmodels/components/deploy-modal.tsx +++ b/src/pages/llmodels/components/deploy-modal.tsx @@ -280,9 +280,19 @@ const AddModal: FC = (props) => { return modelName; }; + const currentModelDuringEvaluate = (item: any) => { + return ( + evaluateStateRef.current.state === EvaluateProccess.form && + item.name === currentSelectedModel.current.name + ); + }; + const handleOnSelectModel = async (item: any, manual?: boolean) => { // If the item is empty or the same as the selected model, do nothing + if (currentModelDuringEvaluate(item)) { + return; + } handleCancelFiles(); if ( _.isEmpty(item) || @@ -328,17 +338,14 @@ const AddModal: FC = (props) => { } }; - const currentModelDuringEvaluate = (item: any) => { - return ( - evaluateStateRef.current.state === EvaluateProccess.form && - item.name === currentSelectedModel.current.name - ); - }; - const handleOnSelectModelAfterEvaluate = (item: any, manual?: boolean) => { if (currentModelDuringEvaluate(item)) { return; } + + if (manual) { + form.current?.form?.resetFields(resetFieldsByModel); + } // If the item is empty setIsGGUF(item.isGGUF); updateSelectedModel(item); @@ -365,6 +372,8 @@ const AddModal: FC = (props) => { categories: getCategory(item) }; + console.log('newFormValues:', newFormValues); + form.current?.setFieldsValue?.(newFormValues); handleOnValuesChangeBefore({