test2 / app.py
itmaru's picture
Update app.py
4e5d952 verified
raw
history blame contribute delete
785 Bytes
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()