abhikaregoudar03 commited on
Commit
e0d5c79
1 Parent(s): ab75e30
Files changed (1) hide show
  1. app.py +32 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline,Conversation
2
+ chatbot = pipeline(model="facebook/blenderbot-400M-distill")
3
+ import gradio as gr
4
+
5
+ message_list= []
6
+ response_list = []
7
+
8
+ def yes_man(message,history):
9
+ conversion = chatbot(message)
10
+
11
+ return conversion[0]['generated_text']
12
+
13
+
14
+
15
+ def yes_man(message,history):
16
+ conversion = chatbot(message)
17
+
18
+ return conversion[0]['generated_text']
19
+
20
+ gr.ChatInterface(
21
+ yes_man,
22
+ chatbot=gr.Chatbot(height=300),
23
+ textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
24
+ title="A vanilla chatbot",
25
+ description="Ask Yes Man any question",
26
+ theme="soft",
27
+ examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
28
+ cache_examples=True,
29
+ retry_btn=None,
30
+ undo_btn="Delete Previous",
31
+ clear_btn="Clear",
32
+ ).launch(share=True)