Fix: add image2text/speech2text/ocr support (#15915)

### What problem does this PR solve?

Fix:  add image2text/speech2text/ocr support

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2026-06-10 20:28:25 +08:00
committed by GitHub
parent acaeb416ca
commit dfa4c5a795

View File

@@ -9,10 +9,8 @@ import { FC, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
export const mapModelKey = {
IMAGE2TEXT: 'VLM',
'TEXT EMBEDDING': 'Embedding',
SPEECH2TEXT: 'ASR',
'TEXT RE-RANK': 'Rerank',
image2text: 'VLM',
speech2text: 'ASR',
chat: 'LLM',
vision: 'VLM',
embedding: 'Embedding',
@@ -28,6 +26,8 @@ const orderMap: Record<ModelType, number> = {
rerank: 3,
tts: 4,
asr: 5,
speech2text: 5,
image2text: 6,
vision: 6,
ocr: 7,
};
@@ -38,6 +38,8 @@ type ModelType =
| 'rerank'
| 'tts'
| 'asr'
| 'speech2text'
| 'image2text'
| 'vision'
| 'ocr';
@@ -89,10 +91,8 @@ export const AvailableModels: FC<{
factoryList.forEach((model) => {
model.model_types.forEach((type) => tagsSet.add(type));
});
return Array.from(tagsSet).sort(
(a, b) =>
(orderMap[a as ModelType] || 999) - (orderMap[b as ModelType] || 999),
);
const res = sortModelTypes(Array.from(tagsSet));
return res;
}, [factoryList]);
const handleTagClick = (tag: string) => {