Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
ca-certificates \
|
| 5 |
libstdc++6 \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
|
|
|
| 8 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 9 |
|
| 10 |
-
#
|
| 11 |
ENV PIP_ONLY_BINARY=:all:
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
|
|
|
| 16 |
RUN pip install --no-cache-dir "huggingface_hub<0.25.0" gradio
|
| 17 |
|
|
|
|
| 18 |
WORKDIR /app
|
| 19 |
COPY . .
|
| 20 |
-
|
| 21 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# 1. Use Python 3.9 Slim (Good choice)
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# 2. Install system libraries (Required for the AI engine)
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
ca-certificates \
|
| 7 |
libstdc++6 \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# 3. Upgrade pip tools
|
| 11 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 12 |
|
| 13 |
+
# 4. SAFETY LOCK: Prevent compiling (Crucial for speed)
|
| 14 |
ENV PIP_ONLY_BINARY=:all:
|
| 15 |
|
| 16 |
+
# 5. THE FIX: Install llama-cpp-python using the CPU Wheel Server
|
| 17 |
+
# We added '--extra-index-url' so it knows where to find the file.
|
| 18 |
+
RUN pip install --no-cache-dir \
|
| 19 |
+
llama-cpp-python==0.2.48 \
|
| 20 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 21 |
|
| 22 |
+
# 6. Install the rest (Pinned to prevent the "HfFolder" crash)
|
| 23 |
RUN pip install --no-cache-dir "huggingface_hub<0.25.0" gradio
|
| 24 |
|
| 25 |
+
# 7. Run
|
| 26 |
WORKDIR /app
|
| 27 |
COPY . .
|
| 28 |
+
CMD ["python", "app.py"]
|
|
|