Spaces:
Runtime error
Runtime error
| from transformers import pipeline, Conversation | |
| chatbot = pipeline("conversational", model="microsoft/DialoGPT-small") | |
| def chat_fn(message, history=[]): | |
| conversation = Conversation(message) | |
| response = chatbot(conversation) | |
| return response.generated_responses[-1] | |
| import gradio as gr | |
| iface = gr.ChatInterface( | |
| chat_fn, | |
| title="Чат-помощник для детей", | |
| description="Я помогу тебе с вопросами, поддержу и объясню сложные вещи простыми словами.", | |
| examples=["Что делать, если я устал?", "Объясни задачу по математике простыми словами."], | |
| theme="soft" | |
| ) | |
| iface.launch() | |