vortex123 commited on
Commit
97eaf87
·
verified ·
1 Parent(s): 3a3437f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -89,10 +89,12 @@ with gr.Blocks() as demo:
89
  additional_inputs=[model_selection],
90
  title="Gemini Chat",
91
  description="Общайтесь с моделями Gemini от Google.",
92
- type="messages",
93
- clear=lambda: ("", "") # Функция для очистки chatbot и thinking_output
94
  )
95
 
 
 
 
96
  def change_chatbot(model_name):
97
  return gr.ChatInterface.update() # No need to change the processing function here
98
 
@@ -102,5 +104,8 @@ with gr.Blocks() as demo:
102
  outputs=[chatbot],
103
  )
104
 
 
 
 
105
  if __name__ == "__main__":
106
  demo.launch()
 
89
  additional_inputs=[model_selection],
90
  title="Gemini Chat",
91
  description="Общайтесь с моделями Gemini от Google.",
92
+ type="messages"
 
93
  )
94
 
95
+ with gr.Row():
96
+ clear_button = gr.Button("Очистить")
97
+
98
  def change_chatbot(model_name):
99
  return gr.ChatInterface.update() # No need to change the processing function here
100
 
 
104
  outputs=[chatbot],
105
  )
106
 
107
+ clear_button.click(clear_thinking, outputs=[thinking_output], queue=False)
108
+ clear_button.click(lambda: None, None, chatbot, queue=False) # Clear chatbot history
109
+
110
  if __name__ == "__main__":
111
  demo.launch()