fix: compatibility message for gguf

This commit is contained in:
jialin
2025-11-23 15:10:46 +08:00
parent e5755a2eec
commit de0982d590
13 changed files with 55 additions and 35 deletions
@@ -16,6 +16,13 @@ export const backendOptionsMap = {
SGLang: 'SGLang'
};
export const BuiltInBackendOptions = [
backendOptionsMap.vllm,
backendOptionsMap.ascendMindie,
backendOptionsMap.SGLang,
backendOptionsMap.voxBox
];
export interface BackendParameter {
label: string;
value: string;
+13 -10
View File
@@ -9,7 +9,10 @@ import _ from 'lodash';
import { useEffect, useRef, useState } from 'react';
import { evaluationsModelSpec } from '../apis';
import { modelSourceMap, modelTaskMap } from '../config';
import { backendOptionsMap } from '../config/backend-parameters';
import {
backendOptionsMap,
BuiltInBackendOptions
} from '../config/backend-parameters';
import { EvaluateResult, FormData } from '../config/types';
import { generateGPUIds } from '../config/utils';
import useCheckBackend from './use-check-backend';
@@ -334,19 +337,19 @@ export const useCheckCompatibility = () => {
const isOllamaModelFile = isBlobFile || isOllamaModel;
let warningMessage = '';
if (isOllamaModelFile && backend === backendOptionsMap.llamaBox) {
warningMessage = '';
} else if (isOllamaModelFile && backend !== backendOptionsMap.llamaBox) {
warningMessage = intl.formatMessage({
id: 'models.form.ollama.warning'
});
} else if (isGGUFFile && backend !== backendOptionsMap.llamaBox) {
if (
(isGGUFFile || isOllamaModelFile) &&
BuiltInBackendOptions.includes(backend)
) {
warningMessage = intl.formatMessage({
id: 'models.form.backend.warning'
});
} else if (!isGGUFFile && backend === backendOptionsMap.llamaBox) {
} else if (
(isGGUFFile || isOllamaModelFile) &&
!BuiltInBackendOptions.includes(backend)
) {
warningMessage = intl.formatMessage({
id: 'models.form.backend.warning.llamabox'
id: 'models.form.backend.warning.gguf'
});
}