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;
|
||||
};
|
||||
|
||||
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<AddModalProps> = (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<AddModalProps> = (props) => {
|
||||
categories: getCategory(item)
|
||||
};
|
||||
|
||||
console.log('newFormValues:', newFormValues);
|
||||
|
||||
form.current?.setFieldsValue?.(newFormValues);
|
||||
|
||||
handleOnValuesChangeBefore({
|
||||
|
||||
Reference in New Issue
Block a user