Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -221,6 +221,7 @@ with left:
|
|
| 221 |
st.markdown(f"π― **Wants:** {', '.join(p.wants) or 'β'}")
|
| 222 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 223 |
|
|
|
|
| 224 |
# ---------- AI MATCHMAKING ----------
|
| 225 |
with right:
|
| 226 |
st.subheader("π€ AI Matchmaking")
|
|
@@ -248,21 +249,36 @@ with right:
|
|
| 248 |
3,
|
| 249 |
)
|
| 250 |
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
st.markdown(
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
|
| 261 |
-
st.progress(raw_score) # progress bar expects 0-1
|
| 262 |
-
st.caption(f"Match Score: {score_percent}%")
|
| 263 |
-
st.caption(m.get("reason", "AI Match"))
|
| 264 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 265 |
|
|
|
|
| 266 |
# ---------- FEEDBACK ----------
|
| 267 |
with st.sidebar:
|
| 268 |
st.markdown("---")
|
|
|
|
| 221 |
st.markdown(f"π― **Wants:** {', '.join(p.wants) or 'β'}")
|
| 222 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 223 |
|
| 224 |
+
# ---------- AI MATCHMAKING ----------
|
| 225 |
# ---------- AI MATCHMAKING ----------
|
| 226 |
with right:
|
| 227 |
st.subheader("π€ AI Matchmaking")
|
|
|
|
| 249 |
3,
|
| 250 |
)
|
| 251 |
|
| 252 |
+
if not matches:
|
| 253 |
+
st.info("No matches found.")
|
| 254 |
+
else:
|
| 255 |
+
st.markdown("<div class='matches-container'>", unsafe_allow_html=True)
|
| 256 |
+
|
| 257 |
+
for m in matches:
|
| 258 |
+
score_percent = int(float(m.get("score", 0)) * 100) # Convert 0-1 to 0-100%
|
| 259 |
+
st.markdown("<div class='card'>", unsafe_allow_html=True)
|
| 260 |
+
cols = st.columns([1, 3])
|
| 261 |
+
|
| 262 |
+
with cols[0]:
|
| 263 |
+
avatar_path = m.get("avatar")
|
| 264 |
+
if avatar_path and Path(avatar_path).exists():
|
| 265 |
+
st.image(avatar_path, width=80)
|
| 266 |
+
else:
|
| 267 |
+
st.image("https://via.placeholder.com/80", width=80)
|
| 268 |
+
|
| 269 |
+
with cols[1]:
|
| 270 |
+
st.markdown(f"### {m.get('username', 'Unknown')}")
|
| 271 |
+
st.markdown(f"π§ Offers: {', '.join(m.get('offers', [])) or 'β'}")
|
| 272 |
+
st.markdown(f"π― Wants: {', '.join(m.get('wants', [])) or 'β'}")
|
| 273 |
+
st.markdown(f"β° {m.get('availability', 'N/A')} β’ π£ {m.get('preferences', 'β')}")
|
| 274 |
+
st.markdown(f"**Match Score:** {score_percent}%")
|
| 275 |
+
st.caption(m.get("reason", "AI Match"))
|
| 276 |
+
|
| 277 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 278 |
|
|
|
|
|
|
|
|
|
|
| 279 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 280 |
|
| 281 |
+
|
| 282 |
# ---------- FEEDBACK ----------
|
| 283 |
with st.sidebar:
|
| 284 |
st.markdown("---")
|