abdoulayee commited on
Commit
383273d
·
verified ·
1 Parent(s): 83986f5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def afficher_produit(image, nom, prix, categorie, description):
4
+ return f"""
5
+ <div style='text-align:center;'>
6
+ <h2>{nom} - {prix} GNF</h2>
7
+ <p><strong>Catégorie :</strong> {categorie}</p>
8
+ <p>{description}</p>
9
+ <img src='{image}' style='width:250px; height:auto; margin-top:10px;' />
10
+ </div>
11
+ """
12
+
13
+ demo = gr.Interface(
14
+ fn=afficher_produit,
15
+ inputs=[
16
+ gr.Image(type="filepath", label="📸 Photo du produit"),
17
+ gr.Textbox(label="🧾 Nom du produit"),
18
+ gr.Textbox(label="💰 Prix (en GNF)"),
19
+ gr.Dropdown(["Vêtement", "Chaussure", "Accessoire", "Électronique", "Autres"], label="📂 Catégorie"),
20
+ gr.Textbox(label="📝 Description", lines=3)
21
+ ],
22
+ outputs=gr.HTML(label="🛍️ Aperçu du produit"),
23
+ title="🧥 WontanApp - Démo de mise en vente",
24
+ description="Simule la mise en vente d'un produit sur une plateforme de seconde main guinéenne 🇬🇳"
25
+ )
26
+
27
+ demo.launch()