From d9c882399d443b15c453d094c76b291f7e6343fc Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 21 Nov 2024 09:56:28 +0800 Subject: [PATCH] Ensure LIGHTEN work (#3542) ### What problem does this PR solve? #3531 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/settings.py b/api/settings.py index b6afba0e8..94225bc44 100644 --- a/api/settings.py +++ b/api/settings.py @@ -61,7 +61,10 @@ kg_retrievaler = None def init_settings(): - global LLM, LLM_FACTORY, LLM_BASE_URL + global LLM, LLM_FACTORY, LLM_BASE_URL, LIGHTEN, DATABASE_TYPE, DATABASE + LIGHTEN = int(os.environ.get('LIGHTEN', "0")) + DATABASE_TYPE = os.getenv("DB_TYPE", 'mysql') + DATABASE = decrypt_database_config(name=DATABASE_TYPE) LLM = get_base_config("user_default_llm", {}) LLM_FACTORY = LLM.get("factory", "Tongyi-Qianwen") LLM_BASE_URL = LLM.get("base_url")