Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix LIGHTEN issue (#2806)

Kevin Hu2d1c83da592b
diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py
index 100a893bf1..cb49449630 100644
--- a/api/apps/llm_app.py
+++ b/api/apps/llm_app.py
@@ -332,7 +332,7 @@ def my_llms():
@login_required
def list_app():
self_deploied = ["Youdao","FastEmbed", "BAAI", "Ollama", "Xinference", "LocalAI", "LM-Studio"]
- weighted = ["Youdao","FastEmbed", "BAAI"] if LIGHTEN else []
+ weighted = ["Youdao","FastEmbed", "BAAI"] if not LIGHTEN else []
model_type = request.args.get("model_type")
try:
objs = TenantLLMService.query(tenant_id=current_user.id)
diff --git a/api/settings.py b/api/settings.py
index 41dfbe91c2..5078903a3d 100644
--- a/api/settings.py
+++ b/api/settings.py
@@ -123,7 +123,7 @@ if not LIGHTEN:
CHAT_MDL = default_llm[LLM_FACTORY]["chat_model"]
EMBEDDING_MDL = default_llm["BAAI"]["embedding_model"]
- RERANK_MDL = default_llm["BAAI"]["rerank_model"] if not LIGHTEN else ""
+ RERANK_MDL = default_llm["BAAI"]["rerank_model"]
ASR_MDL = default_llm[LLM_FACTORY]["asr_model"]
IMAGE2TEXT_MDL = default_llm[LLM_FACTORY]["image2text_model"]
else:
diff --git a/rag/nlp/__init__.py b/rag/nlp/__init__.py
index 9d8e787633..0928ce4425 100644
--- a/rag/nlp/__init__.py
+++ b/rag/nlp/__init__.py
@@ -501,17 +501,6 @@ def naive_merge(sections, chunk_token_num=128, delimiter="\n。;!?"):
for sec, pos in sections:
add_chunk(sec, pos)
- continue
- s, e = 0, 1
- while e < len(sec):
- if sec[e] in delimiter:
- add_chunk(sec[s: e + 1], pos)
- s = e + 1
- e = s + 1
- else:
- e += 1
- if s < e:
- add_chunk(sec[s: e], pos)
return cks