chore: clear backend parameters、backend_version、env on change backend

This commit is contained in:
jialin
2025-04-11 18:49:06 +08:00
parent 7542ac9d87
commit 092aeceb9d
11 changed files with 102 additions and 95 deletions
+5 -9
View File
@@ -353,14 +353,12 @@ export const useCheckCompatibility = () => {
const isOllamaModel = localPath?.includes('ollama');
const isGGUFFile = localPath.endsWith('.gguf');
const isOllamaModelFile = isBlobFile || isOllamaModel;
let warningMessage = '';
if (isBlobFile && isOllamaModel && backend === backendOptionsMap.llamaBox) {
if (isOllamaModelFile && backend === backendOptionsMap.llamaBox) {
warningMessage = '';
} else if (
isBlobFile &&
isOllamaModel &&
backend !== backendOptionsMap.llamaBox
) {
} else if (isOllamaModelFile && backend !== backendOptionsMap.llamaBox) {
warningMessage = intl.formatMessage({
id: 'models.form.ollama.warning'
});
@@ -488,9 +486,7 @@ export const useCheckCompatibility = () => {
source: source
});
if (res.show) {
setWarningStatus?.(res);
}
setWarningStatus?.(res);
return res;
};