ABANDA-OMGBA-Ulrich-Michel commited on
Commit
4f0c44d
1 Parent(s): 0ad525d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline ,Conversation
3
+
4
+ def talk_together(message, history):
5
+ chatbot=pipeline(model="facebook/blenderbot-400M-distill")
6
+ conversation = chatbot(message)
7
+
8
+ return conversation[0]['generated_text']
9
+
10
+ talk_chatbot = gr.ChatInterface(talk_together, title="MY TALKACTIVE FRIEND" ,chatbot=gr.Chatbot(height=300),
11
+ textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
12
+
13
+ description="Let's Talk Together my Friend",
14
+ theme="soft",
15
+ examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
16
+ cache_examples=True,
17
+ retry_btn=None,
18
+ undo_btn="Delete Previous",
19
+ clear_btn="Clear",)
20
+
21
+ talk_chatbot.launch()