fix: visit auto playground error from model list
This commit is contained in:
@@ -61,6 +61,7 @@ import {
|
||||
backendOptionsMap,
|
||||
getSourceRepoConfigValue,
|
||||
modelCategories,
|
||||
modelCategoriesMap,
|
||||
modelSourceMap
|
||||
} from '../config';
|
||||
import {
|
||||
@@ -357,7 +358,16 @@ const Models: React.FC<ModelsProps> = ({
|
||||
|
||||
const handleOpenPlayGround = (row: any) => {
|
||||
for (const [category, path] of Object.entries(categoryToPathMap)) {
|
||||
console.log('category:', category, path);
|
||||
if (
|
||||
row.categories?.includes(category) &&
|
||||
[
|
||||
modelCategoriesMap.text_to_speech,
|
||||
modelCategoriesMap.speech_to_text
|
||||
].includes(category)
|
||||
) {
|
||||
navigate(`${path}&model=${row.name}`);
|
||||
return;
|
||||
}
|
||||
if (row.categories?.includes(category)) {
|
||||
navigate(`${path}?model=${row.name}`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user