From 655b01a0a40373cfbcd115bb2186d7a9f89e6cd1 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 6 Dec 2024 17:01:19 +0800 Subject: [PATCH] Remove token check while adding model. (#3903) ### What problem does this PR solve? #3820 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/llm_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py index dccd283db..9c7c8dcc4 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(