From dfa4c5a795f6874b6b548c4bd9b31ab88c4bd600 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Wed, 10 Jun 2026 20:28:25 +0800 Subject: [PATCH] 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) --- .../setting-model/components/un-add-model.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/src/pages/user-setting/setting-model/components/un-add-model.tsx b/web/src/pages/user-setting/setting-model/components/un-add-model.tsx index 07c5da943b..1039c7c97f 100644 --- a/web/src/pages/user-setting/setting-model/components/un-add-model.tsx +++ b/web/src/pages/user-setting/setting-model/components/un-add-model.tsx @@ -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 = { 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) => {