Skip to content

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

Remove token check while adding model. (#3903)

Kevin Hu655b01a0a403
diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py
index dccd283db9..9c7c8dcc4f 100644
--- a/api/apps/llm_app.py
+++ b/api/apps/llm_app.py
@@ -216,7 +216,7 @@ def add_llm():
base_url=llm["api_base"])
try:
arr, tc = mdl.encode(["Test if the api key is available"])
- if len(arr[0]) == 0 or tc == 0:
+ if len(arr[0]) == 0:
raise Exception("Fail")
except Exception as e:
msg += f"\nFail to access embedding model({llm['llm_name']})." + str(e)
@@ -242,7 +242,7 @@ def add_llm():
)
try:
arr, tc = mdl.similarity("Hello~ Ragflower!", ["Hi, there!", "Ohh, my friend!"])
- if len(arr) == 0 or tc == 0:
+ if len(arr) == 0:
raise Exception("Not known.")
except Exception as e:
msg += f"\nFail to access model({llm['llm_name']})." + str(