fix: switch model clear backend_parameters, env, backend_version
This commit is contained in:
@@ -280,9 +280,19 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
return modelName;
|
return modelName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const currentModelDuringEvaluate = (item: any) => {
|
||||||
|
return (
|
||||||
|
evaluateStateRef.current.state === EvaluateProccess.form &&
|
||||||
|
item.name === currentSelectedModel.current.name
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const handleOnSelectModel = async (item: any, manual?: boolean) => {
|
const handleOnSelectModel = async (item: any, manual?: boolean) => {
|
||||||
// If the item is empty or the same as the selected model, do nothing
|
// If the item is empty or the same as the selected model, do nothing
|
||||||
|
|
||||||
|
if (currentModelDuringEvaluate(item)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleCancelFiles();
|
handleCancelFiles();
|
||||||
if (
|
if (
|
||||||
_.isEmpty(item) ||
|
_.isEmpty(item) ||
|
||||||
@@ -328,17 +338,14 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentModelDuringEvaluate = (item: any) => {
|
|
||||||
return (
|
|
||||||
evaluateStateRef.current.state === EvaluateProccess.form &&
|
|
||||||
item.name === currentSelectedModel.current.name
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOnSelectModelAfterEvaluate = (item: any, manual?: boolean) => {
|
const handleOnSelectModelAfterEvaluate = (item: any, manual?: boolean) => {
|
||||||
if (currentModelDuringEvaluate(item)) {
|
if (currentModelDuringEvaluate(item)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (manual) {
|
||||||
|
form.current?.form?.resetFields(resetFieldsByModel);
|
||||||
|
}
|
||||||
// If the item is empty
|
// If the item is empty
|
||||||
setIsGGUF(item.isGGUF);
|
setIsGGUF(item.isGGUF);
|
||||||
updateSelectedModel(item);
|
updateSelectedModel(item);
|
||||||
@@ -365,6 +372,8 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
categories: getCategory(item)
|
categories: getCategory(item)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('newFormValues:', newFormValues);
|
||||||
|
|
||||||
form.current?.setFieldsValue?.(newFormValues);
|
form.current?.setFieldsValue?.(newFormValues);
|
||||||
|
|
||||||
handleOnValuesChangeBefore({
|
handleOnValuesChangeBefore({
|
||||||
|
|||||||
Reference in New Issue
Block a user