Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # نحمّل نموذج لغوي جاهز من Hugging Face | |
| generator = pipeline("text-generation", model="aubmindlab/aragpt2-base") | |
| def arabic_text_idea(prompt): | |
| result = generator(prompt, max_length=60, num_return_sequences=1) | |
| return result[0]['generated_text'] | |
| app = gr.Interface( | |
| fn=arabic_text_idea, | |
| inputs=gr.Textbox(lines=2, label="اكتب فكرة أو موضوعًا"), | |
| outputs="text", | |
| title="مولّد الجمل العربية ✨", | |
| description="أدخل فكرة بالعربية وسيكتب الذكاء الاصطناعي جملة عنها." | |
| ) | |
| app.launch() |