Ox1 Cursor commited on
Commit
d099a59
·
1 Parent(s): 2e31b50

fix(deploy): use pre-built CPU wheels to avoid OOM build

Browse files

Compiling llama-cpp-python from source exceeded 16 GB RAM on CPU Basic
(exit 137 OOMKilled). Use whl/cpu and pytorch cpu indexes instead.

- Pin llama-cpp-python==0.3.28 with abetlen cpu wheel index
- Add pytorch.org/whl/cpu for lighter torch install
- Remove cmake/build-essential from packages.txt
- Update local install docs to force-reinstall cu124 after requirements

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (4) hide show
  1. FIELD_NOTES.md +1 -1
  2. README.md +6 -3
  3. packages.txt +0 -2
  4. requirements.txt +3 -1
FIELD_NOTES.md CHANGED
@@ -55,7 +55,7 @@ The custom frontend is designed for my mother: big buttons, clear language, no t
55
 
56
  **VLM attribute extraction isn't perfect.** Gemma 3 4B sometimes confuses "navy" with "black", or calls a blazer a "jacket". At 4B parameters, some accuracy trade-offs are inevitable. The structured JSON parsing with fallback regex helps catch malformed responses.
57
 
58
- **Cold start on Spaces.** Downloading a 3GB GGUF model on first launch takes time. CPU Basic compiles `llama-cpp-python` from source and downloads torch — expect 815 minutes on first boot. Inference is CPU-only (~30–90 s per garment).
59
 
60
  ## Stack
61
 
 
55
 
56
  **VLM attribute extraction isn't perfect.** Gemma 3 4B sometimes confuses "navy" with "black", or calls a blazer a "jacket". At 4B parameters, some accuracy trade-offs are inevitable. The structured JSON parsing with fallback regex helps catch malformed responses.
57
 
58
+ **Cold start on Spaces.** First build downloads pre-built CPU wheels (no compilation). Expect 3–5 minutes for pip install, then ~23 minutes for the first GGUF download. Inference is CPU-only (~30–90 s per garment).
59
 
60
  ## Stack
61
 
README.md CHANGED
@@ -74,11 +74,14 @@ Set `HF_TOKEN` in Space Secrets before first use (required for model and dataset
74
  cd packages/wardrobe-us
75
  python -m venv .venv && source .venv/bin/activate
76
 
77
- # Install with CUDA 12.4 GPU acceleration (recommended):
78
- pip install llama-cpp-python \
79
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
80
  pip install -r requirements.txt
81
 
 
 
 
 
 
82
  # Custom minimal frontend (default — gr.Server + Alpine.js):
83
  python app.py
84
 
 
74
  cd packages/wardrobe-us
75
  python -m venv .venv && source .venv/bin/activate
76
 
77
+ # Base deps (CPU wheels same as HF Space):
 
 
78
  pip install -r requirements.txt
79
 
80
+ # Override llama-cpp-python with CUDA 12.4 GPU wheel:
81
+ pip install llama-cpp-python==0.3.28 \
82
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124 \
83
+ --force-reinstall --no-deps
84
+
85
  # Custom minimal frontend (default — gr.Server + Alpine.js):
86
  python app.py
87
 
packages.txt CHANGED
@@ -1,3 +1 @@
1
- cmake
2
- build-essential
3
  libopenblas-dev
 
 
 
1
  libopenblas-dev
requirements.txt CHANGED
@@ -1,5 +1,7 @@
 
 
 
1
  gradio==6.17.3
2
- llama-cpp-python>=0.3.28
3
  huggingface-hub>=1.18.0
4
  Pillow>=12.0.0
5
  boto3>=1.35.0
 
1
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
2
+ --extra-index-url https://download.pytorch.org/whl/cpu
3
+ llama-cpp-python==0.3.28
4
  gradio==6.17.3
 
5
  huggingface-hub>=1.18.0
6
  Pillow>=12.0.0
7
  boto3>=1.35.0