File size: 1,724 Bytes
89161e2
 
 
 
 
 
 
 
 
 
 
 
78a8d31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: Gifty Plus
emoji: 👁
colorFrom: green
colorTo: pink
sdk: gradio
sdk_version: 5.42.0
app_file: app.py
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference


A hybrid gift recommender (catalog + DIY + personalized message).  
**Tip:** If your hardware allows, switch text/rerank models to larger ones via Space Variables for better quality.

### Hardware
- **CPU Basic**: works out of the box (default models in `app.py`)
- **CPU Upgrade**: faster embeddings & generation
- **GPU (T4/A10G)**: recommended for larger FLAN models and stronger rerankers

### Model knobs (set in *Settings → Variables & secrets → Space variables*)  
You can override these without editing code:

- `EMBED_MODEL_ID`  
  - CPU OK (default): `sentence-transformers/all-MiniLM-L12-v2`  
  - Better (slower, still CPU OK): `sentence-transformers/all-mpnet-base-v2`

- `DIY_MODEL_ID` (FLAN for the DIY section)  
  - CPU: `google/flan-t5-small` or `google/flan-t5-base`  
  - GPU: `google/flan-t5-large` (noticeably better)

- `MSG_MODEL_ID` (personalized message)  
  - CPU: `google/flan-t5-base`  
  - GPU: `google/flan-t5-large`  
  - Keeps diversity via stochastic sampling + validators.

- `RERANK_MODEL_ID` (optional cross-encoder re-ranker)  
  - CPU: `cross-encoder/ms-marco-MiniLM-L-6-v2`  
  - GPU: `cross-encoder/ms-marco-MiniLM-L-12-v2` or `BAAI/bge-reranker-base`

### Notes
- Age/Gender are **filters only** (not weighted) — avoid mismatches (e.g., kids’ items for adults).
- Interests and Occasion are given stronger weight in ranking.
- The message generator is **non-generic**: uses randomized temperatures/top-p with validators and anti-duplication.