import gradio as gr from transformers import pipeline, Conversation chatbot = pipeline("conversational", model="microsoft/DialoGPT-small") def chat_with_bot(user_input, history=[]): conversation = Conversation(user_input) convo = chatbot(conversation) response = convo.generated_responses[-1] history.append((user_input, response)) return response, history demo = gr.Interface( fn=chat_with_bot, inputs=[ gr.Textbox(lines=2, placeholder="Say something..."), gr.State() ], outputs=[ gr.Textbox(lines=6, label="🤖 Bot says"), gr.State() ], title="💬 Everyday Chatbot", description="Talk to your AI buddy about anything — life, school, ideas, or just random stuff!" ) demo.launch()