Spaces:
Sleeping
Sleeping
JohnSmith9982
commited on
Commit
•
dd1d703
1
Parent(s):
a4b196a
Upload 38 files
Browse files- modules/config.py +3 -2
- modules/webui_locale.py +1 -1
modules/config.py
CHANGED
@@ -66,10 +66,11 @@ if os.environ.get("dockerrun") == "yes":
|
|
66 |
|
67 |
## 处理 api-key 以及 允许的用户列表
|
68 |
my_api_key = config.get("openai_api_key", "")
|
69 |
-
my_api_key = os.environ.get("
|
70 |
|
71 |
xmchat_api_key = config.get("xmchat_api_key", "")
|
72 |
-
os.environ
|
|
|
73 |
|
74 |
## 多账户机制
|
75 |
multi_api_key = config.get("multi_api_key", False) # 是否开启多账户机制
|
|
|
66 |
|
67 |
## 处理 api-key 以及 允许的用户列表
|
68 |
my_api_key = config.get("openai_api_key", "")
|
69 |
+
my_api_key = os.environ.get("OPENAI_API_KEY", my_api_key)
|
70 |
|
71 |
xmchat_api_key = config.get("xmchat_api_key", "")
|
72 |
+
if os.environ.get("XMCHAT_API_KEY", None) == None:
|
73 |
+
os.environ["XMCHAT_API_KEY"] = xmchat_api_key
|
74 |
|
75 |
## 多账户机制
|
76 |
multi_api_key = config.get("multi_api_key", False) # 是否开启多账户机制
|
modules/webui_locale.py
CHANGED
@@ -10,7 +10,7 @@ class I18nAuto:
|
|
10 |
else:
|
11 |
config = {}
|
12 |
lang_config = config.get("language", "auto")
|
13 |
-
language = os.environ.get("
|
14 |
if language == "auto":
|
15 |
language = locale.getdefaultlocale()[0] # get the language code of the system (ex. zh_CN)
|
16 |
self.language_map = {}
|
|
|
10 |
else:
|
11 |
config = {}
|
12 |
lang_config = config.get("language", "auto")
|
13 |
+
language = os.environ.get("LANGUAGE", lang_config)
|
14 |
if language == "auto":
|
15 |
language = locale.getdefaultlocale()[0] # get the language code of the system (ex. zh_CN)
|
16 |
self.language_map = {}
|