File size: 461 Bytes
812c522
9a9419d
812c522
9a9419d
2af7a0e
 
 
 
 
 
 
 
 
 
9a9419d
812c522
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline, Conversation

# Load small BlenderBot model
chatbot = pipeline("conversational", model="facebook/blenderbot_small-90M")

def chat(message, history=[]):
    conversation = Conversation(message)
    chatbot(conversation)
    response = conversation.generated_responses[-1]
    return response

with gr.Blocks() as demo:
    gr.Markdown("## 🤖 Sumit AI Chatbot")
    gr.ChatInterface(fn=chat)

demo.launch()