Abid commited on
Commit
702efd2
1 Parent(s): 5aa0565

chatbot blocks added

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -42,13 +42,14 @@ with demo:
42
  </center>
43
  """
44
  )
45
-
46
- gr.Interface(
47
- fn=predict,
48
- theme="default",
49
- css=".footer {display:none !important}",
50
- inputs=["text", "state"],
51
- outputs=["chatbot", "state"],
52
  )
53
 
 
 
 
54
  demo.launch()
 
42
  </center>
43
  """
44
  )
45
+ state = gr.Variable(default_value=[])
46
+ chatbot = gr.Chatbot()
47
+ text = gr.Textbox(
48
+ label="Talk to Morty here... (press enter to submit)",
49
+ default_value="How are you?",
 
 
50
  )
51
 
52
+ text.submit(predict, [text, state], [chatbot, state])
53
+ text.submit(lambda x: "", text, text)
54
+
55
  demo.launch()