fix: backend is not updated after changing model

This commit is contained in:
jialin
2025-04-02 11:24:26 +08:00
parent 28a84a90cf
commit b1d7bb9fd7
6 changed files with 40 additions and 18 deletions
+6 -2
View File
@@ -102,6 +102,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
return modelTaskData;
};
// just for setting the model name or repo_id, and the backend, Since the model type is fixed.
const handleOnSelectModel = (selectModel: any) => {
let name = _.split(selectModel.name, '/').slice(-1)[0];
const reg = /(-gguf)$/i;
@@ -117,12 +118,15 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
backend:
modelTaskData.type === modelTaskMap.audio
? backendOptionsMap.voxBox
: form.getFieldValue('backend')
: selectModel.isGGUF
? backendOptionsMap.llamaBox
: backendOptionsMap.vllm
});
} else {
form.setFieldsValue({
ollama_library_model_name: selectModel.name,
name: name
name: name,
backend: backendOptionsMap.llamaBox
});
}
};