Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +10 -5
- 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 |
-
#
|
| 21 |
-
#
|
| 22 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
RUN CMAKE_ARGS="-DGGML_CUDA=OFF -DGGML_METAL=OFF -DGGML_OPENCL=OFF" \
|
| 24 |
-
|
| 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 |
-
#
|
|
|
|
| 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
|