fomext commited on
Commit
5f2a604
Β·
verified Β·
1 Parent(s): 7e229ed

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -5
  2. requirements.txt +2 -1
Dockerfile CHANGED
@@ -17,12 +17,17 @@ WORKDIR /app
17
  COPY requirements.txt .
18
 
19
  # ── Python deps (single source of truth: requirements.txt) ───
20
- # CMAKE_ARGS/FORCE_CMAKE apply to the whole install so llama-cpp-python
21
- # gets built from source as CPU-only; the other packages are unaffected.
22
- # See requirements.txt for why the llama-cpp-python version matters.
 
 
 
 
23
  RUN CMAKE_ARGS="-DGGML_CUDA=OFF -DGGML_METAL=OFF -DGGML_OPENCL=OFF" \
24
- FORCE_CMAKE=1 \
25
- pip install --no-cache-dir -r requirements.txt
 
26
 
27
  # ── App code ─────────────────────────────────────────────────
28
  COPY app.py .
 
17
  COPY requirements.txt .
18
 
19
  # ── Python deps (single source of truth: requirements.txt) ───
20
+ # Install llama-cpp-python from abetlen's prebuilt CPU wheel index
21
+ # instead of compiling it from source: building llama.cpp's C++ tree
22
+ # from scratch spawns several parallel compiler processes and was
23
+ # OOMing the build (exit 137) on the platform's build container.
24
+ # CMAKE_ARGS / CMAKE_BUILD_PARALLEL_LEVEL only matter if pip ever has
25
+ # to fall back to a source build (e.g. no matching wheel for this
26
+ # platform yet) -- they keep that fallback CPU-only and memory-bounded.
27
  RUN CMAKE_ARGS="-DGGML_CUDA=OFF -DGGML_METAL=OFF -DGGML_OPENCL=OFF" \
28
+ CMAKE_BUILD_PARALLEL_LEVEL=1 \
29
+ pip install --no-cache-dir -r requirements.txt \
30
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
31
 
32
  # ── App code ─────────────────────────────────────────────────
33
  COPY app.py .
requirements.txt CHANGED
@@ -4,5 +4,6 @@ pydantic==2.7.1
4
  # Must be >=0.3.9 -- that's the release that added Qwen3 architecture
5
  # support to llama.cpp. Anything older will fail to load a Qwen3 GGUF
6
  # with "Failed to load model from file".
7
- # Built from source by the Dockerfile with CPU-only CMAKE_ARGS (no CUDA / Metal).
 
8
  llama-cpp-python==0.3.30
 
4
  # Must be >=0.3.9 -- that's the release that added Qwen3 architecture
5
  # support to llama.cpp. Anything older will fail to load a Qwen3 GGUF
6
  # with "Failed to load model from file".
7
+ # Installed by the Dockerfile from abetlen's prebuilt CPU wheel index
8
+ # (not compiled from source -- compiling timed out/OOMed the build).
9
  llama-cpp-python==0.3.30