File size: 785 Bytes
7e3862e
4e5d952
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7e3862e
4e5d952
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()