File size: 673 Bytes
21d1a1b
e8b45b6
 
21d1a1b
e8b45b6
7b21796
21d1a1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from transformers import pipeline

# Load the Hugging Face model
chatbot = pipeline("conversational", model="facebook/blenderbot-400M-distill")

# Function to handle conversation with the chatbot
def chat_with_bot(message):
    response = chatbot(message)
    return response[0]['generated_text']

# Create the Gradio interface
iface = gr.Interface(
    fn=chat_with_bot,
    inputs=gr.Textbox(label="Enter your message"),
    outputs=gr.Textbox(label="Bot Response"),
    live=True,
    title="Indian Recipe Chatbot",
    description="Ask me about Indian recipes or ingredients, and I'll help you out!",
)

# Launch the Gradio interface
iface.launch()