JohnSmith9982 commited on
Commit
014266c
1 Parent(s): bb06661

Upload 166 files

Browse files
Files changed (2) hide show
  1. ChuanhuChatbot.py +2 -1
  2. modules/config.py +3 -0
ChuanhuChatbot.py CHANGED
@@ -18,7 +18,8 @@ import gradio as gr
18
  import colorama
19
  from modules.gradio_patch import reg_patch
20
 
21
- reg_patch()
 
22
 
23
  logging.getLogger("httpx").setLevel(logging.WARNING)
24
 
 
18
  import colorama
19
  from modules.gradio_patch import reg_patch
20
 
21
+ if not hfspaceflag:
22
+ reg_patch()
23
 
24
  logging.getLogger("httpx").setLevel(logging.WARNING)
25
 
modules/config.py CHANGED
@@ -32,6 +32,7 @@ __all__ = [
32
  "show_api_billing",
33
  "chat_name_method_index",
34
  "HIDE_MY_KEY",
 
35
  ]
36
 
37
  # 添加一个统一的config文件,避免文件过多造成的疑惑(优先级最低)
@@ -85,6 +86,8 @@ dockerflag = config.get("dockerflag", False)
85
  if os.environ.get("dockerrun") == "yes":
86
  dockerflag = True
87
 
 
 
88
  # 处理 api-key 以及 允许的用户列表
89
  my_api_key = config.get("openai_api_key", "")
90
  my_api_key = os.environ.get("OPENAI_API_KEY", my_api_key)
 
32
  "show_api_billing",
33
  "chat_name_method_index",
34
  "HIDE_MY_KEY",
35
+ "hfspaceflag",
36
  ]
37
 
38
  # 添加一个统一的config文件,避免文件过多造成的疑惑(优先级最低)
 
86
  if os.environ.get("dockerrun") == "yes":
87
  dockerflag = True
88
 
89
+ hfspaceflag = os.environ.get("HF_SPACE", "false") == "true"
90
+
91
  # 处理 api-key 以及 允许的用户列表
92
  my_api_key = config.get("openai_api_key", "")
93
  my_api_key = os.environ.get("OPENAI_API_KEY", my_api_key)