Spaces:
Runtime error
Runtime error
| 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() | |