import gradio as gr | |
import os | |
# قراءة التوكن من Secret | |
hf_token = os.getenv("esamoai5") | |
def chat_with_ai(message): | |
return f"توكنك يعمل! الرسالة: {message}" | |
iface = gr.Interface( | |
fn=chat_with_ai, | |
inputs=gr.Textbox(lines=2, placeholder="اكتب رسالتك هنا..."), | |
outputs=gr.Textbox(label="رد الذكاء الاصطناعي") | |
) | |
iface.launch() |