Spaces:
Sleeping
Sleeping
app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,8 @@ def summarize(input_text, clear_history=False):
|
|
22 |
summary = output[0]['summary_text']
|
23 |
|
24 |
# Append the user's input and the summary to chat history
|
25 |
-
chat_history.append(("User
|
|
|
26 |
|
27 |
# Return the updated chat history
|
28 |
return chat_history
|
@@ -39,7 +40,7 @@ with gr.Blocks() as interface:
|
|
39 |
clear_history_btn = gr.Button("Clear History")
|
40 |
|
41 |
# Chatbot-style output
|
42 |
-
chatbot = gr.Chatbot(label="History")
|
43 |
|
44 |
# Submit button for summarization
|
45 |
submit_button = gr.Button("Summarize")
|
|
|
22 |
summary = output[0]['summary_text']
|
23 |
|
24 |
# Append the user's input and the summary to chat history
|
25 |
+
chat_history.append(("User", input_text))
|
26 |
+
chat_history.append(("Summarizer", summary))
|
27 |
|
28 |
# Return the updated chat history
|
29 |
return chat_history
|
|
|
40 |
clear_history_btn = gr.Button("Clear History")
|
41 |
|
42 |
# Chatbot-style output
|
43 |
+
chatbot = gr.Chatbot(label="History", type="messages")
|
44 |
|
45 |
# Submit button for summarization
|
46 |
submit_button = gr.Button("Summarize")
|