fix: jump to playground from model list

This commit is contained in:
jialin
2024-11-28 21:48:14 +08:00
parent bd418b23dc
commit 51ae3a16bd
16 changed files with 760 additions and 366 deletions
+21 -1
View File
@@ -347,7 +347,27 @@ const Models: React.FC<ModelsProps> = ({
};
const handleOpenPlayGround = (row: any) => {
navigate(`/playground?model=${row.name}`);
if (row.image_only) {
navigate(`/playground/text-to-image?model=${row.name}`);
return;
}
if (row.text_to_speech) {
navigate(`/playground/speech?model=${row.name}&type=tts`);
return;
}
if (row.speech_to_text) {
navigate(`/playground/speech?model=${row.name}&type=stt`);
return;
}
if (row.reranker) {
navigate(`/playground/rerank?model=${row.name}`);
return;
}
if (row.embedding_only) {
navigate(`/playground/embedding?model=${row.name}`);
return;
}
navigate(`/playground/chat?model=${row.name}`);
};
const handleViewLogs = async (row: any) => {