| from transformers import pipeline | |
| import gradio as gr | |
| # Загружаем модель (можно указать свою модель на Hugging Face) | |
| pipe = pipeline("text2text-generation", model="HaveAI/FlareNew") # <-- Заменяй на свою модель! | |
| def chat_with_flare(prompt): | |
| system_prompt = "Ты ИИ по имени Flare. Отвечай дружелюбно и умно." | |
| full_prompt = f"{system_prompt}\nПользователь: {prompt}\nFlare:" | |
| result = pipe(full_prompt, max_new_tokens=100, temperature=0.7) | |
| return result[0]["generated_text"] | |
| # Интерфейс в браузере | |
| iface = gr.Interface(fn=chat_with_flare, inputs="text", outputs="text", title="Flare Chatbot") | |
| iface.launch() | |