import gradio as gr from huggingface_hub import InferenceClient client = InferenceClient("MaxKio/Mio-1.0-Pro") def generate_text(prompt): if not prompt.strip(): return "من فضلك اكتب أمراً أولاً." try: response = client.text_generation( prompt, max_new_tokens=512, temperature=0.7, return_full_text=False ) return response except Exception as e: return f"خطأ في الاتصال بالنموذج: {str(e)}\nتأكد من أن مسار النموذج متاح للعامة." # بناء الواجهة - بدون theme هنا with gr.Blocks() as demo: gr.Markdown("#