fix: audio model use voxbox only

This commit is contained in:
jialin
2025-04-24 17:23:25 +08:00
parent dc8e9e3fef
commit 0497e2052d
6 changed files with 49 additions and 34 deletions
+2 -1
View File
@@ -247,7 +247,8 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
<FormInnerContext.Provider
value={{
onBackendChange: handleBackendChange
onBackendChange: handleBackendChange,
gpuOptions: gpuOptions
}}
>
<HuggingFaceForm></HuggingFaceForm>
@@ -20,7 +20,6 @@ import {
queryModelScopeModelFiles
} from '../apis';
import { backendOptionsMap, modelSourceMap } from '../config';
import { checkOnlyAscendNPU } from '../hooks';
import '../style/hf-model-file.less';
import ModelFileItem from './model-file-item';
import TitleWrapper from './title-wrapper';
@@ -237,9 +236,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
try {
const evaluateFileList = list.map((item: any) => {
return {
backend: checkOnlyAscendNPU(gpuOptions || [])
? backendOptionsMap.ascendMindie
: backendOptionsMap.llamaBox,
backend: backendOptionsMap.llamaBox,
source: modelSource,
...(modelSource === modelSourceMap.huggingface_value
? {
+9 -12
View File
@@ -21,11 +21,10 @@ import {
ModelScopeSortType,
ModelSortType,
ModelscopeTaskMap,
backendOptionsMap,
modelSourceMap
} from '../config';
import { handleRecognizeAudioModel } from '../config/audio-catalog';
import { checkOnlyAscendNPU } from '../hooks';
import { checkCurrentbackend } from '../hooks';
import SearchStyle from '../style/search-result.less';
import SearchInput from './search-input';
import SearchResult from './search-result';
@@ -215,17 +214,15 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
const res = handleRecognizeAudioModel(item, modelSource);
let backendObj = {};
if (checkOnlyAscendNPU?.(gpuOptions || [])) {
const backend = checkCurrentbackend({
isGGUF: item.isGGUF,
isAudio: res.isAudio,
gpuOptions: gpuOptions || []
});
if (backend) {
backendObj = {
backend: backendOptionsMap.ascendMindie
};
} else if (res.isAudio) {
backendObj = {
backend: backendOptionsMap.voxBox
};
} else if (item.isGGUF) {
backendObj = {
backend: backendOptionsMap.llamaBox
backend: backend
};
}