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