mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user