Update app.py
Browse files
app.py
CHANGED
|
@@ -75,28 +75,33 @@ def run_ven_engine(budget, dietary, company, purpose, noise):
|
|
| 75 |
match_pct = int(similarities[closest_persona] * 100)
|
| 76 |
review_text = str(top_match[col_review])[:160] + "..."
|
| 77 |
|
|
|
|
| 78 |
return f"""
|
| 79 |
-
<div style="background: white; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px;">
|
| 80 |
<div style="display:flex; justify-content:space-between;">
|
| 81 |
<div>
|
| 82 |
-
<div style="font-size: 22px; font-weight: 800; color: #
|
| 83 |
-
<div style="font-size: 14px; color: #
|
| 84 |
</div>
|
| 85 |
<div style="text-align:right;">
|
| 86 |
<div style="font-size: 28px; font-weight: 900; color: #2563eb;">{top_match[col_rating]}</div>
|
| 87 |
-
<div style="font-size:12px; font-weight:bold; color:#
|
| 88 |
</div>
|
| 89 |
</div>
|
| 90 |
-
<hr style="border:0; border-top:1px solid #
|
| 91 |
-
<p style="color:#
|
| 92 |
<div style="margin-top:15px; font-size:13px; font-weight:700; color:#2563eb;">Match Confidence: {match_pct}%</div>
|
| 93 |
</div>
|
| 94 |
"""
|
| 95 |
|
| 96 |
# ==========================================
|
| 97 |
-
# 3. APP UI
|
| 98 |
# ==========================================
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
with gr.Blocks(css=ven_css, title="VEN Project") as demo:
|
| 102 |
gr.Markdown("# 🍔 VEN: Restaurant Matchmaker")
|
|
@@ -106,10 +111,7 @@ with gr.Blocks(css=ven_css, title="VEN Project") as demo:
|
|
| 106 |
in_budget = gr.Dropdown(["Budget-friendly", "Mid-range", "Premium"], label="Budget", value="Mid-range")
|
| 107 |
in_diet = gr.Dropdown(["Anything", "Vegetarian", "Vegan", "Meat-lover"], label="Diet", value="Anything")
|
| 108 |
in_company = gr.Radio(["Solo", "Date/Couple", "Friends", "Business"], label="With who?", value="Date/Couple")
|
| 109 |
-
|
| 110 |
-
# --- FIX IS HERE: Added "Professional meeting" to the list ---
|
| 111 |
in_purpose = gr.Dropdown(["Casual dinner", "Special occasion", "Quick bite", "Professional meeting"], label="Occasion", value="Casual dinner")
|
| 112 |
-
|
| 113 |
in_noise = gr.Radio(["Quiet/Intimate", "Moderate/Social", "Lively/Music"], label="Environment", value="Moderate/Social")
|
| 114 |
btn = gr.Button("Find My Table", variant="primary")
|
| 115 |
|
|
|
|
| 75 |
match_pct = int(similarities[closest_persona] * 100)
|
| 76 |
review_text = str(top_match[col_review])[:160] + "..."
|
| 77 |
|
| 78 |
+
# --- VISIBILITY FIX: Added 'color:black' to all text elements ---
|
| 79 |
return f"""
|
| 80 |
+
<div style="background: white; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px; color: black;">
|
| 81 |
<div style="display:flex; justify-content:space-between;">
|
| 82 |
<div>
|
| 83 |
+
<div style="font-size: 22px; font-weight: 800; color: #000000;">{top_match[col_name]}</div>
|
| 84 |
+
<div style="font-size: 14px; color: #333333; font-weight: 600;">Match for: {closest_persona}</div>
|
| 85 |
</div>
|
| 86 |
<div style="text-align:right;">
|
| 87 |
<div style="font-size: 28px; font-weight: 900; color: #2563eb;">{top_match[col_rating]}</div>
|
| 88 |
+
<div style="font-size:12px; font-weight:bold; color: #000000;">RATING</div>
|
| 89 |
</div>
|
| 90 |
</div>
|
| 91 |
+
<hr style="border:0; border-top:1px solid #cbd5e1; margin: 15px 0;">
|
| 92 |
+
<p style="color: #000000; line-height:1.6; font-size: 16px; font-weight: 500;"><i>"{review_text}"</i></p>
|
| 93 |
<div style="margin-top:15px; font-size:13px; font-weight:700; color:#2563eb;">Match Confidence: {match_pct}%</div>
|
| 94 |
</div>
|
| 95 |
"""
|
| 96 |
|
| 97 |
# ==========================================
|
| 98 |
+
# 3. APP UI & CSS FIX
|
| 99 |
# ==========================================
|
| 100 |
+
# Added 'color: black !important' to force dark text everywhere
|
| 101 |
+
ven_css = """
|
| 102 |
+
body { background: radial-gradient(1200px 600px at 20% 0%, #eef6ff 0%, #f8fafc 45%, #ffffff 100%) !important; font-family: sans-serif !important; color: black !important; }
|
| 103 |
+
h1, h2, h3, h4, h5, h6, span, p, div { color: black; }
|
| 104 |
+
"""
|
| 105 |
|
| 106 |
with gr.Blocks(css=ven_css, title="VEN Project") as demo:
|
| 107 |
gr.Markdown("# 🍔 VEN: Restaurant Matchmaker")
|
|
|
|
| 111 |
in_budget = gr.Dropdown(["Budget-friendly", "Mid-range", "Premium"], label="Budget", value="Mid-range")
|
| 112 |
in_diet = gr.Dropdown(["Anything", "Vegetarian", "Vegan", "Meat-lover"], label="Diet", value="Anything")
|
| 113 |
in_company = gr.Radio(["Solo", "Date/Couple", "Friends", "Business"], label="With who?", value="Date/Couple")
|
|
|
|
|
|
|
| 114 |
in_purpose = gr.Dropdown(["Casual dinner", "Special occasion", "Quick bite", "Professional meeting"], label="Occasion", value="Casual dinner")
|
|
|
|
| 115 |
in_noise = gr.Radio(["Quiet/Intimate", "Moderate/Social", "Lively/Music"], label="Environment", value="Moderate/Social")
|
| 116 |
btn = gr.Button("Find My Table", variant="primary")
|
| 117 |
|