chore: extract a model file item

This commit is contained in:
jialin
2025-04-08 19:19:41 +08:00
parent 5766a50bc2
commit d62e43790c
23 changed files with 207 additions and 142 deletions
@@ -24,7 +24,7 @@ import {
backendOptionsMap,
modelSourceMap
} from '../config';
import { identifyModelTask } from '../config/audio-catalog';
import { handleRecognizeAudioModel } from '../config/audio-catalog';
import SearchStyle from '../style/search-result.less';
import SearchInput from './search-input';
import SearchResult from './search-result';
@@ -206,9 +206,9 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
}
try {
const repoList = list.map((item) => {
const isAuido = identifyModelTask(modelSource, item.name);
const res = handleRecognizeAudioModel(item, modelSource);
return {
...(isAuido ? { backend: backendOptionsMap.voxBox } : {}),
...(res.isAudio ? { backend: backendOptionsMap.voxBox } : {}),
source: modelSource,
...(modelSource === modelSourceMap.huggingface_value
? {