chore: extract a model file item
This commit is contained in:
@@ -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
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user