Mychatbot / app.py
Sunder34's picture
Update app.py
620a098 verified
raw
history blame
585 Bytes
from transformers import pipeline
import gradio as gr
chatbot = pipeline("conversational", model="facebook/blenderbot-400M-distill")
message_list = []
response_list = []
def vanilla_chatbot(message, history):
global message_list, response_list
message_list.append(message)
bot_response = chatbot(message_list)
response_list.append(bot_response[-1]['generated_text'])
return bot_response[-1]['generated_text']
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Mashdemy Chatbot", description="Enter text to start chatting.")
demo_chatbot.launch(share=True)