Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -3
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
# Use the standard Python 3.11 image for better compatibility
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
WORKDIR /app
|
|
@@ -14,7 +14,21 @@ ENV TRANSFORMERS_CACHE=/app/.cache \
|
|
| 14 |
HF_HOME=/app/.cache \
|
| 15 |
CHROMADB_DISABLE_TELEMETRY=true
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
COPY requirements.txt .
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
|
|
|
| 1 |
+
# Use the standard Python 3.11 image for better compatibility
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
WORKDIR /app
|
|
|
|
| 14 |
HF_HOME=/app/.cache \
|
| 15 |
CHROMADB_DISABLE_TELEMETRY=true
|
| 16 |
|
| 17 |
+
# --- FIX: Auto-detect architecture and install the correct pre-built wheel ---
|
| 18 |
+
# This block detects the CPU architecture and downloads the corresponding binary,
|
| 19 |
+
# completely avoiding slow compilation.
|
| 20 |
+
RUN ARCH=$(uname -m) && \
|
| 21 |
+
case "$ARCH" in \
|
| 22 |
+
x86_64) \
|
| 23 |
+
WHEEL_URL="https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.78/llama_cpp_python-0.2.78-cp311-cp311-manylinux_2_28_x86_64.whl" ;; \
|
| 24 |
+
aarch64) \
|
| 25 |
+
WHEEL_URL="https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.78/llama_cpp_python-0.2.78-cp311-cp311-manylinux_2_28_aarch64.whl" ;; \
|
| 26 |
+
*) \
|
| 27 |
+
echo "Unsupported architecture: $ARCH" && exit 1 ;; \
|
| 28 |
+
esac && \
|
| 29 |
+
pip install --no-cache-dir "$WHEEL_URL"
|
| 30 |
+
|
| 31 |
+
# Now, install the rest of the dependencies from requirements.txt
|
| 32 |
COPY requirements.txt .
|
| 33 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 34 |
|