Tuchuanhuhuhu commited on
Commit
1f8ae59
·
1 Parent(s): ac55605

fix file uploading error

Browse files
ChuanhuChatbot.py CHANGED
@@ -9,7 +9,7 @@ from modules.models.models import get_model
9
  from modules.train_func import *
10
  from modules.repo import *
11
  from modules.webui import *
12
- from modules.overwrites import *
13
  from modules.presets import *
14
  from modules.utils import *
15
  from modules.config import *
@@ -19,8 +19,7 @@ import colorama
19
 
20
  logging.getLogger("httpx").setLevel(logging.WARNING)
21
 
22
- gr.Chatbot._postprocess_chat_messages = postprocess_chat_messages
23
- gr.Chatbot.postprocess = postprocess
24
 
25
  # with open("web_assets/css/ChuanhuChat.css", "r", encoding="utf-8") as f:
26
  # ChuanhuChatCSS = f.read()
 
9
  from modules.train_func import *
10
  from modules.repo import *
11
  from modules.webui import *
12
+ from modules.overwrites import patch_gradio
13
  from modules.presets import *
14
  from modules.utils import *
15
  from modules.config import *
 
19
 
20
  logging.getLogger("httpx").setLevel(logging.WARNING)
21
 
22
+ patch_gradio()
 
23
 
24
  # with open("web_assets/css/ChuanhuChat.css", "r", encoding="utf-8") as f:
25
  # ChuanhuChatCSS = f.read()
locale/en_US.json CHANGED
@@ -63,7 +63,7 @@
63
  "额外模型列表": "Extra model list",
64
  "默认模型": "Default model",
65
  "获取资源错误": "Error retrieving resources.",
66
- "该模型不支持多模态输入": "This model does not support multi-modal input.",
67
  " 中。": ".",
68
  " 为: ": " as: ",
69
  " 吗?": " ?",
 
63
  "额外模型列表": "Extra model list",
64
  "默认模型": "Default model",
65
  "获取资源错误": "Error retrieving resources.",
66
+ "该模型不支持多模态输入": "This model does not accept multi-modal input.",
67
  " 中。": ".",
68
  " 为: ": " as: ",
69
  " 吗?": " ?",
modules/models/base_model.py CHANGED
@@ -419,7 +419,7 @@ class BaseLLMModel:
419
  other_files = [f.name for f in other_files]
420
  else:
421
  other_files = None
422
- return gr.File.update(value=other_files), chatbot, status
423
 
424
  def summarize_index(self, files, chatbot, language):
425
  status = gr.Markdown()
 
419
  other_files = [f.name for f in other_files]
420
  else:
421
  other_files = None
422
+ return gr.File(value=other_files), chatbot, status
423
 
424
  def summarize_index(self, files, chatbot, language):
425
  status = gr.Markdown()
modules/overwrites.py CHANGED
@@ -92,8 +92,12 @@ def init_with_class_name_as_elem_classes(original_func):
92
  return res
93
  return wrapper
94
 
95
- original_Component_init = gr.components.Component.__init__
96
- gr.components.Component.__init__ = init_with_class_name_as_elem_classes(original_Component_init)
97
- gr.components.FormComponent.__init__ = init_with_class_name_as_elem_classes(original_Component_init)
 
98
 
99
- gr.blocks.BlockContext.__init__ = init_with_class_name_as_elem_classes(gr.blocks.BlockContext.__init__)
 
 
 
 
92
  return res
93
  return wrapper
94
 
95
+ def patch_gradio():
96
+ original_Component_init = gr.components.Component.__init__
97
+ gr.components.Component.__init__ = init_with_class_name_as_elem_classes(original_Component_init)
98
+ gr.components.FormComponent.__init__ = init_with_class_name_as_elem_classes(original_Component_init)
99
 
100
+ gr.blocks.BlockContext.__init__ = init_with_class_name_as_elem_classes(gr.blocks.BlockContext.__init__)
101
+
102
+ # gr.Chatbot._postprocess_chat_messages = postprocess_chat_messages
103
+ # gr.Chatbot.postprocess = postprocess