Spaces:
Paused
Paused
fix: wheel CUDA precompilado (--only-binary) en base runtime, sin compilar
Browse files- Dockerfile +12 -14
Dockerfile
CHANGED
|
@@ -1,16 +1,15 @@
|
|
| 1 |
-
# Imagen base CUDA 12.1 *
|
| 2 |
-
# llama-cpp-python
|
| 3 |
-
#
|
| 4 |
-
FROM nvidia/cuda:12.1.1-
|
| 5 |
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
|
| 8 |
-
# Python + Stockfish + libs de OpenCV
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
-
python3 python3-pip
|
| 11 |
stockfish \
|
| 12 |
libgl1 libglib2.0-0 \
|
| 13 |
-
build-essential cmake git \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
WORKDIR /app
|
|
@@ -26,13 +25,12 @@ RUN pip3 install --no-cache-dir --upgrade pip \
|
|
| 26 |
RUN pip3 install --no-cache-dir torch torchvision \
|
| 27 |
--index-url https://download.pytorch.org/whl/cu121
|
| 28 |
|
| 29 |
-
# llama-cpp-python
|
| 30 |
-
#
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
pip3 install --no-cache-dir llama-cpp-python==0.3.2
|
| 36 |
|
| 37 |
# Resto de dependencias de la app
|
| 38 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
| 1 |
+
# Imagen base CUDA 12.1 *runtime*: trae las libs CUDA para que el wheel
|
| 2 |
+
# precompilado de llama-cpp-python offloadee a la T4. NO compilamos (compilar
|
| 3 |
+
# en el builder de HF muere por OOM); usamos wheel ya hecho del indice cu121.
|
| 4 |
+
FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
|
| 5 |
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
|
| 8 |
+
# Python + Stockfish + libs de OpenCV (sin toolchain: no compilamos nada)
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
+
python3 python3-pip \
|
| 11 |
stockfish \
|
| 12 |
libgl1 libglib2.0-0 \
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
WORKDIR /app
|
|
|
|
| 25 |
RUN pip3 install --no-cache-dir torch torchvision \
|
| 26 |
--index-url https://download.pytorch.org/whl/cu121
|
| 27 |
|
| 28 |
+
# llama-cpp-python: SOLO wheel precompilado con CUDA (--only-binary). Sin fijar
|
| 29 |
+
# version → toma la más nueva que tenga wheel cu121 para py3.10. Si no hay wheel,
|
| 30 |
+
# falla en SEGUNDOS (no intenta compilar 25 min). La API que usa qwen.py es estable.
|
| 31 |
+
RUN pip3 install --no-cache-dir --only-binary llama-cpp-python \
|
| 32 |
+
llama-cpp-python \
|
| 33 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
|
|
|
|
| 34 |
|
| 35 |
# Resto de dependencias de la app
|
| 36 |
RUN pip3 install --no-cache-dir -r requirements.txt
|