AnatoliiG commited on
Commit
74b0917
·
1 Parent(s): 66c2c20

Update components.py

Browse files
Files changed (1) hide show
  1. src/ui/components.py +14 -6
src/ui/components.py CHANGED
@@ -76,12 +76,20 @@ def create_ui():
76
 
77
  # Основная область чата
78
  with gr.Column(elem_id="col-chat-main"):
79
- chatbot = gr.Chatbot(
80
- elem_id="chatbot",
81
- show_label=False,
82
- # bubble_full_width=False,
83
- fill_height=True,
84
- )
 
 
 
 
 
 
 
 
85
 
86
  # Область ввода, прижатая к низу
87
  with gr.Row(elem_id="input-area"):
 
76
 
77
  # Основная область чата
78
  with gr.Column(elem_id="col-chat-main"):
79
+ chatbot_kwargs = {
80
+ "elem_id": "chatbot",
81
+ "show_label": False,
82
+ "bubble_full_width": False,
83
+ "fill_height": True,
84
+ }
85
+ try:
86
+ chatbot = gr.Chatbot(**chatbot_kwargs)
87
+ except TypeError as e:
88
+ err_msg = str(e)
89
+ for key in list(chatbot_kwargs.keys()):
90
+ if key in err_msg:
91
+ chatbot_kwargs.pop(key, None)
92
+ chatbot = gr.Chatbot(**chatbot_kwargs)
93
 
94
  # Область ввода, прижатая к низу
95
  with gr.Row(elem_id="input-area"):