ssooraj commited on
Commit
fd3db55
·
verified ·
1 Parent(s): 2e9d438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -1,12 +1,21 @@
 
 
1
  import gradio as gr
2
- chatbot = pipeline(model="facebook/blenderbot-400M-distill")
3
  message_list = []
4
  response_list = []
 
 
5
  def vanilla_chatbot(message, history):
6
- conversation = Conversation(text=message, past_user_inputs=message_list,
7
- generated_responses=response_list)
8
- bot = chatbot(conversation.messages[0]['content']) # working code
9
- return bot[-1]['generated_text']
10
- demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Mashdemy Chatbot", description="Enter text to start
11
- chatting.")
12
- demo_chatbot.launch(share = True)
 
 
 
 
 
 
1
+ #!/usr/bin/python
2
+ # -*- coding: utf-8 -*-
3
  import gradio as gr
4
+ chatbot = pipeline(model='facebook/blenderbot-400M-distill')
5
  message_list = []
6
  response_list = []
7
+
8
+
9
  def vanilla_chatbot(message, history):
10
+ conversation = Conversation(text=message,
11
+ past_user_inputs=message_list,
12
+ generated_responses=response_list)
13
+ bot = chatbot(conversation.messages[0]['content']) # working code
14
+ return bot[-1]['generated_text']
15
+
16
+
17
+ demo_chatbot = gr.ChatInterface(vanilla_chatbot,
18
+ title='Mashdemy Chatbot',
19
+ description='Enter text to start chatting.'
20
+ )
21
+ demo_chatbot.launch(share=True)