AzizBenAmmar7 commited on
Commit
5616ae7
·
1 Parent(s): f67fb7d

fix: Remove allow_flagging parameter for Gradio 6.x compatibility

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -47,7 +47,7 @@ def recommend_outfit_api(clothes_json: str, preference: str, city: str = "Tunis"
47
  "message": "Erreur lors de la recommandation"
48
  }, indent=2)
49
 
50
- # ✅ SOLUTION : Utiliser gr.Interface qui expose automatiquement /api/predict
51
  demo = gr.Interface(
52
  fn=recommend_outfit_api,
53
  inputs=[
@@ -80,9 +80,8 @@ demo = gr.Interface(
80
  "Tunis"
81
  ]
82
  ],
83
- # ✅ CRUCIAL : Ces paramètres exposent l'API
84
- api_name="predict",
85
- allow_flagging="never"
86
  )
87
 
88
  if __name__ == "__main__":
@@ -91,4 +90,4 @@ if __name__ == "__main__":
91
  server_name="0.0.0.0",
92
  server_port=7860,
93
  share=False
94
- )
 
47
  "message": "Erreur lors de la recommandation"
48
  }, indent=2)
49
 
50
+ # ✅ SOLUTION FINALE : gr.Interface SANS allow_flagging
51
  demo = gr.Interface(
52
  fn=recommend_outfit_api,
53
  inputs=[
 
80
  "Tunis"
81
  ]
82
  ],
83
+ api_name="predict"
84
+ # ❌ SUPPRIMÉ : allow_flagging="never" (cause l'erreur TypeError en Gradio 6.x)
 
85
  )
86
 
87
  if __name__ == "__main__":
 
90
  server_name="0.0.0.0",
91
  server_port=7860,
92
  share=False
93
+ )