Spaces:
Sleeping
Sleeping
Commit ·
c19c852
1
Parent(s): 8a61b15
Fix: Update Gradio 6.x API endpoint configuration
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def recommend_outfit_api(clothes_json: str, preference: str, city: str = "Tunis"
|
|
| 27 |
except Exception as e:
|
| 28 |
return json.dumps({"success": False, "error": str(e)})
|
| 29 |
|
| 30 |
-
# ✅ Interface Gradio - gr.Interface
|
| 31 |
iface = gr.Interface(
|
| 32 |
fn=recommend_outfit_api,
|
| 33 |
inputs=[
|
|
@@ -53,8 +53,9 @@ iface = gr.Interface(
|
|
| 53 |
"Tunis"
|
| 54 |
]
|
| 55 |
],
|
| 56 |
-
# ✅
|
| 57 |
-
#
|
|
|
|
| 58 |
)
|
| 59 |
|
| 60 |
# ✅ Lancement de l'interface
|
|
|
|
| 27 |
except Exception as e:
|
| 28 |
return json.dumps({"success": False, "error": str(e)})
|
| 29 |
|
| 30 |
+
# ✅ Interface Gradio - gr.Interface avec api_name explicite pour Gradio 6.x
|
| 31 |
iface = gr.Interface(
|
| 32 |
fn=recommend_outfit_api,
|
| 33 |
inputs=[
|
|
|
|
| 53 |
"Tunis"
|
| 54 |
]
|
| 55 |
],
|
| 56 |
+
# ✅ CRUCIAL : api_name est nécessaire pour Gradio 6.x
|
| 57 |
+
# Cela expose l'endpoint /api/predict
|
| 58 |
+
api_name="predict"
|
| 59 |
)
|
| 60 |
|
| 61 |
# ✅ Lancement de l'interface
|