From fb2cf3e703dcb5b3608b92022f5d01537ec12621 Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 25 Aug 2026 13:26:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(display):=20=E7=9F=A5=E8=AF=86=E5=BA=93?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=98=BE=E7=A4=BA=E5=8F=8B=E5=A5=BD=E5=90=91?= =?UTF-8?q?=E9=87=8F=E5=BC=95=E6=93=8E=E5=90=8D(=E6=96=87=E6=9C=AC=20bge-m?= =?UTF-8?q?3=20/=20=E5=A4=9A=E5=AA=92=E4=BD=93=20CLIP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rag/init.py | 2 +- wwwroot/knowledge_bases_list/kb_list.dspy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/init.py b/rag/init.py index 98a4d14..4456b25 100644 --- a/rag/init.py +++ b/rag/init.py @@ -41,7 +41,7 @@ async def kb_list_handler(request, params_kw, *args, **kwargs): size_str = f"{total_size/1024:.0f}KB" else: size_str = f"{total_size}B" - engine = r.embedding_engine or "CLIP" + engine = {'bge-m3': '文本 bge-m3', 'clip-vith14': '多媒体 CLIP', 'CLIP ViT-H-14': '多媒体 CLIP'}.get((r.embedding_engine or '').strip(), (r.embedding_engine or 'CLIP')) card = {"widgettype":"VBox","options":{"cwidth":16,"cheight":12,"bgcolor":"#f0f7ff","padding":"16px","css":"card clickable","border":"1px solid #d0e4f7"},"subwidgets":[ {"widgettype":"Text","options":{"text":"📚 " + str(r.name),"cfontsize":16,"fontWeight":"bold"}}, {"widgettype":"Text","options":{"text":str(engine)+" · 1024维","cfontsize":12,"color":"#888"}}, diff --git a/wwwroot/knowledge_bases_list/kb_list.dspy b/wwwroot/knowledge_bases_list/kb_list.dspy index c827a68..1ad0f67 100644 --- a/wwwroot/knowledge_bases_list/kb_list.dspy +++ b/wwwroot/knowledge_bases_list/kb_list.dspy @@ -16,7 +16,7 @@ async with get_sor_context(env, 'rag') as sor: size_str = "%.0fKB" % (total_size / 1024) else: size_str = str(total_size) + "B" - engine = r.embedding_engine or "CLIP" + engine = {'bge-m3': '文本 bge-m3', 'clip-vith14': '多媒体 CLIP', 'CLIP ViT-H-14': '多媒体 CLIP'}.get((r.embedding_engine or '').strip(), (r.embedding_engine or 'CLIP')) idstr = str(r.id) namestr = r.name or '' cards.append({