aksharasoman commited on
Commit
4de6624
·
verified ·
1 Parent(s): e00e4f6

Create app.py

Browse files

Here, the chatbot will not remember previous messages. Every message is considered new.

Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline, Conversation
2
+ import gradio as gr
3
+ chatbot = pipeline(task="conversational",model="facebook/blenderbot-400M-distill")
4
+
5
+ def launch(msg):
6
+ conversation = Conversation(msg)
7
+ conversation = chatbot(conversation)
8
+ return conversation
9
+
10
+ iface = gr.Interface(launch,
11
+ inputs= gr.Textbox(),outputs="text")
12
+
13
+ iface.launch(share=True)
14
+