Spaces:
Runtime error
Runtime error
Update app.py
#1
by
Sunder34
- opened
app.py
CHANGED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
-
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
chatbot = pipeline(model="facebook/blenderbot-400M-distill")
|
|
|
|
| 5 |
message_list = []
|
| 6 |
response_list = []
|
| 7 |
|
| 8 |
def vanilla_chatbot(message, history):
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Mashdemy Chatbot", description="Enter text to start chatting.")
|
| 14 |
-
demo_chatbot.launch(share
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
chatbot = pipeline("conversational", model="facebook/blenderbot-400M-distill")
|
| 5 |
+
|
| 6 |
message_list = []
|
| 7 |
response_list = []
|
| 8 |
|
| 9 |
def vanilla_chatbot(message, history):
|
| 10 |
+
global message_list, response_list
|
| 11 |
+
message_list.append(message)
|
| 12 |
+
bot_response = chatbot(message_list)
|
| 13 |
+
response_list.append(bot_response[-1]['generated_text'])
|
| 14 |
+
return bot_response[-1]['generated_text']
|
| 15 |
+
|
| 16 |
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Mashdemy Chatbot", description="Enter text to start chatting.")
|
| 17 |
+
demo_chatbot.launch(share=True)
|