- Load ml-32m links.csv at boot and build movielens_id <-> tmdb_id maps so
every API response now carries a tmdb_id alongside the MovieLens movie_id
- Cache the active model's item embedding matrix once (MF: item_emb.weight,
TwoTower: _all_item_reprs()) so /similar is one matmul against a centroid
- POST /similar accepts {seed_tmdb_ids, k, exclude_tmdb_ids}, scores all
items against the centroid of seed embeddings, masks seeds+excludes, and
falls back to popularity when no seeds resolve
- /info now reports embedding_dim and tmdb mapping status
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Use /tmp for writable runtime paths on HF Spaces
moecr7+1: Claude Opus 4.7 (1M context)
1332a34
/home/user/app is read-only at runtime on HF Spaces, so ensure_dataset
fails to create data/raw. Override paths.raw_dir and paths.processed_dir
to /tmp/rc-ranked/data/* via load_config overrides. Checkpoints remain
in the read-only image.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fix HF Spaces runtime: chdir to app root before resolving relative paths
moecr7+1: Claude Opus 4.7 (1M context)
3c255e2
HF Spaces' Docker runtime does not preserve the Dockerfile WORKDIR, so the
config's relative paths (data/raw, checkpoints/) were resolving against a
read-only CWD ("/"), causing PermissionError when ensure_dataset tried to
mkdir "data/". Resolve the app root from __file__ and chdir at boot.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bundle MF + Two-Tower checkpoints, drop hard Drive dependency
moecr7+1: Claude Opus 4.7 (1M context)
45ad768
- checkpoints/{mf_best.pt, two_tower_best.pt} ship via Git LFS (190MB total)
- Dockerfile now COPYs checkpoints/ into the image
- app.py: ACTIVE_MODEL env var picks mf or two_tower; auto-derives the
checkpoint path. CHECKPOINT_PATH overrides explicitly. GDRIVE_CHECKPOINT_ID
is now an optional fallback only used when the local path is missing.
- README documents the bundled checkpoints and held-out metrics
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dockerize rc-ranked: FastAPI service for HF Spaces
moecr7+1: Claude Opus 4.7 (1M context)
188f0cf
- Dockerfile (python:3.11-slim, CPU-only torch, non-root user, port 7860)
- FastAPI app at recsys.serving.app with /health, /info, /recommend/{user_id}, /recommend/cold
- Bootstrap downloads checkpoint from Google Drive (GDRIVE_CHECKPOINT_ID secret)
then runs ensure_dataset + preprocess + leave_one_out_split before serving
- README updated with HF Space metadata (sdk: docker, app_port: 7860) and
configuration / endpoint docs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>