RahulGanapathy commited on
Commit
c53e8fd
·
verified ·
1 Parent(s): 8fbc968

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- return history
 
40
 
41
  # Create Gradio chatbot UI
42
  demo = gr.Interface(
43
  fn=respond,
44
  inputs=["text", "state"], # ✅ Pass state properly
45
- outputs=["chatbot", "state"], # ✅ Chatbot is dynamically handled
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,