Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,7 @@ class chatgpt:
|
|
| 27 |
def Clean(self):
|
| 28 |
self.history.clear()
|
| 29 |
self.conversation.clear()
|
|
|
|
| 30 |
|
| 31 |
# User input
|
| 32 |
block = gr.Blocks()
|
|
@@ -43,7 +44,7 @@ with block:
|
|
| 43 |
submit = gr.Button("Send")
|
| 44 |
submit.click(chatgpt.answer_chatgpt, inputs=[api_key, message, state], outputs=[chatbot, state])
|
| 45 |
clean = gr.Button("Clean")
|
| 46 |
-
clean.click(chatgpt.Clean)
|
| 47 |
gr.Examples(
|
| 48 |
examples=["Write a poem about artificial intelligence",
|
| 49 |
"What could the future be like?",
|
|
|
|
| 27 |
def Clean(self):
|
| 28 |
self.history.clear()
|
| 29 |
self.conversation.clear()
|
| 30 |
+
return self.history, self.history
|
| 31 |
|
| 32 |
# User input
|
| 33 |
block = gr.Blocks()
|
|
|
|
| 44 |
submit = gr.Button("Send")
|
| 45 |
submit.click(chatgpt.answer_chatgpt, inputs=[api_key, message, state], outputs=[chatbot, state])
|
| 46 |
clean = gr.Button("Clean")
|
| 47 |
+
clean.click(chatgpt.Clean, outputs=[chatbot, state])
|
| 48 |
gr.Examples(
|
| 49 |
examples=["Write a poem about artificial intelligence",
|
| 50 |
"What could the future be like?",
|