Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
c98021c
1
Parent(s):
6a81e5d
bugfix: 修复 log 不打印的问题
Browse files- ChuanhuChatbot.py +5 -3
- modules/config.py +0 -7
ChuanhuChatbot.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
# -*- coding:utf-8 -*-
|
2 |
-
import os
|
3 |
import logging
|
4 |
-
|
|
|
|
|
|
|
5 |
|
6 |
import gradio as gr
|
7 |
|
@@ -289,7 +291,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
289 |
elem_classes="view_only_textbox",
|
290 |
)
|
291 |
# changeAPIURLBtn = gr.Button(i18n("🔄 切换API地址"))
|
292 |
-
|
293 |
updateChuanhuBtn = gr.Button(visible=False, elem_classes="invisible_btn", elem_id="update_chuanhu_btn")
|
294 |
|
295 |
gr.Markdown(CHUANHU_DESCRIPTION, elem_id="description")
|
|
|
1 |
# -*- coding:utf-8 -*-
|
|
|
2 |
import logging
|
3 |
+
logging.basicConfig(
|
4 |
+
level=logging.INFO,
|
5 |
+
format="%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s",
|
6 |
+
)
|
7 |
|
8 |
import gradio as gr
|
9 |
|
|
|
291 |
elem_classes="view_only_textbox",
|
292 |
)
|
293 |
# changeAPIURLBtn = gr.Button(i18n("🔄 切换API地址"))
|
294 |
+
|
295 |
updateChuanhuBtn = gr.Button(visible=False, elem_classes="invisible_btn", elem_id="update_chuanhu_btn")
|
296 |
|
297 |
gr.Markdown(CHUANHU_DESCRIPTION, elem_id="description")
|
modules/config.py
CHANGED
@@ -16,7 +16,6 @@ __all__ = [
|
|
16 |
"auth_list",
|
17 |
"dockerflag",
|
18 |
"retrieve_proxy",
|
19 |
-
"log_level",
|
20 |
"advance_docs",
|
21 |
"update_doc_config",
|
22 |
"usage_limit",
|
@@ -155,12 +154,6 @@ def retrieve_openai_api(api_key=None):
|
|
155 |
os.environ["OPENAI_API_KEY"] = old_api_key
|
156 |
|
157 |
|
158 |
-
# 处理log
|
159 |
-
log_level = config.get("log_level", "INFO")
|
160 |
-
logging.basicConfig(
|
161 |
-
level=log_level,
|
162 |
-
format="%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s",
|
163 |
-
)
|
164 |
|
165 |
# 处理代理:
|
166 |
http_proxy = os.environ.get("HTTP_PROXY", "")
|
|
|
16 |
"auth_list",
|
17 |
"dockerflag",
|
18 |
"retrieve_proxy",
|
|
|
19 |
"advance_docs",
|
20 |
"update_doc_config",
|
21 |
"usage_limit",
|
|
|
154 |
os.environ["OPENAI_API_KEY"] = old_api_key
|
155 |
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
# 处理代理:
|
159 |
http_proxy = os.environ.get("HTTP_PROXY", "")
|