| import gradio as gr |
| from transformers import pipeline |
|
|
| |
| chatbot = pipeline("conversational", model="AllyArc/llama_allyarc") |
|
|
| def chat_fn(message, history=[]): |
| response = chatbot(message) |
| return str(response) |
|
|
| iface = gr.Interface( |
| fn=chat_fn, |
| inputs=gr.inputs.Textbox(label="Ваш вопрос", lines=2, placeholder="Напиши или скажи свой вопрос..."), |
| outputs="text", |
| title="ИИ-наставник для детей", |
| description="Задайте вопрос по искусственному интеллекту, Python и другим темам. Я объясню просто и помогу разобраться!", |
| allow_flagging="never" |
| ) |
| iface.launch() |