Commit ·
ef2c02c
1
Parent(s): 97c145f
Fix UI issues: ALS user IDs, remove shaking animation, improve card alignment
Browse files- README.md +1 -1
- app_streamlit.py +7 -11
README.md
CHANGED
|
@@ -22,7 +22,7 @@ A hybrid recommendation system combining three powerful approaches:
|
|
| 22 |
📊 Model insights and explanations
|
| 23 |
|
| 24 |
## Demo Users
|
| 25 |
-
Try these user IDs: `
|
| 26 |
|
| 27 |
## Tech Stack
|
| 28 |
- **Frontend**: Streamlit
|
|
|
|
| 22 |
📊 Model insights and explanations
|
| 23 |
|
| 24 |
## Demo Users
|
| 25 |
+
Try these user IDs: `1`, `2`, `3`, `5`, `8`, `10`, `12`, `15`, `20`, `25`
|
| 26 |
|
| 27 |
## Tech Stack
|
| 28 |
- **Frontend**: Streamlit
|
app_streamlit.py
CHANGED
|
@@ -16,20 +16,12 @@ st.set_page_config(page_title="InstaRec - Your Grocery Store", layout="wide", in
|
|
| 16 |
# Custom CSS for ultra-modern, creative DARK MODE styling
|
| 17 |
st.markdown("""
|
| 18 |
<style>
|
| 19 |
-
/* Main app background
|
| 20 |
.stApp {
|
| 21 |
background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #0f172a 100%);
|
| 22 |
-
background-size: 200% 200%;
|
| 23 |
-
animation: gradient 15s ease infinite;
|
| 24 |
color: #d1d5db; /* Default light text color */
|
| 25 |
}
|
| 26 |
|
| 27 |
-
@keyframes gradient {
|
| 28 |
-
0% { background-position: 0% 50%; }
|
| 29 |
-
50% { background-position: 100% 50%; }
|
| 30 |
-
100% { background-position: 0% 50%; }
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
/* Reduce main padding */
|
| 34 |
.block-container {
|
| 35 |
padding-top: 2rem;
|
|
@@ -194,6 +186,8 @@ st.markdown("""
|
|
| 194 |
flex: 1;
|
| 195 |
display: flex;
|
| 196 |
flex-direction: column;
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
|
| 199 |
.product-title {
|
|
@@ -202,7 +196,8 @@ st.markdown("""
|
|
| 202 |
color: #f9fafb; /* Light text */
|
| 203 |
margin-bottom: 0.5rem;
|
| 204 |
line-height: 1.4;
|
| 205 |
-
|
|
|
|
| 206 |
}
|
| 207 |
|
| 208 |
.product-dept {
|
|
@@ -466,7 +461,8 @@ st.markdown("""
|
|
| 466 |
CATALOG_PATH = Path("data/processed/catalog_with_dept_images.parquet")
|
| 467 |
THUMBNAILS_DIR = Path("assets/thumbnails")
|
| 468 |
FALLBACK_IMG = THUMBNAILS_DIR / "missing.jpg"
|
| 469 |
-
|
|
|
|
| 470 |
|
| 471 |
# LightGBM Model paths
|
| 472 |
ARTIFACT_DIR = Path("models/lightgbm_ranker")
|
|
|
|
| 16 |
# Custom CSS for ultra-modern, creative DARK MODE styling
|
| 17 |
st.markdown("""
|
| 18 |
<style>
|
| 19 |
+
/* Main app background - static to prevent shaking */
|
| 20 |
.stApp {
|
| 21 |
background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #0f172a 100%);
|
|
|
|
|
|
|
| 22 |
color: #d1d5db; /* Default light text color */
|
| 23 |
}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
/* Reduce main padding */
|
| 26 |
.block-container {
|
| 27 |
padding-top: 2rem;
|
|
|
|
| 186 |
flex: 1;
|
| 187 |
display: flex;
|
| 188 |
flex-direction: column;
|
| 189 |
+
justify-content: space-between;
|
| 190 |
+
min-height: 180px;
|
| 191 |
}
|
| 192 |
|
| 193 |
.product-title {
|
|
|
|
| 196 |
color: #f9fafb; /* Light text */
|
| 197 |
margin-bottom: 0.5rem;
|
| 198 |
line-height: 1.4;
|
| 199 |
+
height: 2.8rem;
|
| 200 |
+
overflow: hidden;
|
| 201 |
}
|
| 202 |
|
| 203 |
.product-dept {
|
|
|
|
| 461 |
CATALOG_PATH = Path("data/processed/catalog_with_dept_images.parquet")
|
| 462 |
THUMBNAILS_DIR = Path("assets/thumbnails")
|
| 463 |
FALLBACK_IMG = THUMBNAILS_DIR / "missing.jpg"
|
| 464 |
+
# Demo user IDs (matching the demo dataset created with 10 users)
|
| 465 |
+
USER_IDS = [1, 2, 3, 5, 8, 10, 12, 15, 20, 25]
|
| 466 |
|
| 467 |
# LightGBM Model paths
|
| 468 |
ARTIFACT_DIR = Path("models/lightgbm_ranker")
|