Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -3,11 +3,12 @@ import gradio as gr
3
  def reply_to_user(text):
4
  return f"👋 أهلاً، إنت كتبت: {text}"
5
 
6
- with gr.Blocks() as demo:
7
- gr.Markdown("## نموذج تجريبي")
8
- inp = gr.Textbox(label="اكتب رسالة")
9
- out = gr.Textbox(label="الرد")
10
- # هنا api_name بيتحدد بشكل صحيح
11
- inp.submit(reply_to_user, inp, out, api_name="predict")
12
 
13
- demo.launch()
 
 
3
  def reply_to_user(text):
4
  return f"👋 أهلاً، إنت كتبت: {text}"
5
 
6
+ demo = gr.Interface(
7
+ fn=reply_to_user,
8
+ inputs=gr.Textbox(label="اكتب رسالة"),
9
+ outputs=gr.Textbox(label="الرد"),
10
+ api_name="predict" # هنا مضمون 100% لأنه Interface مش Blocks
11
+ )
12
 
13
+ if __name__ == "__main__":
14
+ demo.launch()