| import gradio as gr | |
| from model import load_model, generate_answer | |
| # تحميل النموذج المدرب من Hugging Face Hub | |
| pipe = load_model() | |
| # وظيفة الرد على المستخدم | |
| def respond(question): | |
| return generate_answer(pipe, question) | |
| # واجهة Gradio | |
| gr.Interface( | |
| fn=respond, | |
| inputs=gr.Textbox(lines=3, placeholder="اكتب سؤالك هنا..."), | |
| outputs="text", | |
| title="🧠 Veltrix - MGZON Assistant", | |
| description="مساعد مدرب للإجابة على الأسئلة حول منصة MGZON و OAuth" | |
| ).launch() | |