Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,13 +36,14 @@ def respond(message, history):
|
|
| 36 |
# ✅ Append correctly formatted tuple to history
|
| 37 |
history.append((message, bot_reply))
|
| 38 |
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
# Create Gradio chatbot UI
|
| 42 |
demo = gr.Interface(
|
| 43 |
fn=respond,
|
| 44 |
inputs=["text", "state"], # ✅ Pass state properly
|
| 45 |
-
outputs=["chatbot", "state"], # ✅
|
| 46 |
title="Misinformation Detection Chatbot",
|
| 47 |
description="Ask anything, and the chatbot will verify whether it's true or false.",
|
| 48 |
live=True,
|
|
|
|
| 36 |
# ✅ Append correctly formatted tuple to history
|
| 37 |
history.append((message, bot_reply))
|
| 38 |
|
| 39 |
+
# ✅ Return chatbot history and state (Fixes ValueError)
|
| 40 |
+
return history, history
|
| 41 |
|
| 42 |
# Create Gradio chatbot UI
|
| 43 |
demo = gr.Interface(
|
| 44 |
fn=respond,
|
| 45 |
inputs=["text", "state"], # ✅ Pass state properly
|
| 46 |
+
outputs=["chatbot", "state"], # ✅ Ensure state is included in outputs
|
| 47 |
title="Misinformation Detection Chatbot",
|
| 48 |
description="Ask anything, and the chatbot will verify whether it's true or false.",
|
| 49 |
live=True,
|