Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -5,7 +5,8 @@ FROM python:3.10-slim
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# 1. Install System Dependencies
|
| 8 |
-
# ADDED: 'cmake' is strictly required
|
|
|
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
git \
|
| 11 |
curl \
|
|
@@ -17,8 +18,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 17 |
RUN curl -L -o /app/VT323.ttf https://github.com/google/fonts/raw/main/ofl/vt323/VT323-Regular.ttf
|
| 18 |
|
| 19 |
# 3. Install Python Dependencies
|
| 20 |
-
# CHANGED: Split
|
| 21 |
-
|
|
|
|
| 22 |
RUN pip install --no-cache-dir \
|
| 23 |
torch \
|
| 24 |
torchvision \
|
|
@@ -32,8 +34,11 @@ RUN pip install --no-cache-dir \
|
|
| 32 |
pillow \
|
| 33 |
diskcache \
|
| 34 |
safetensors \
|
| 35 |
-
scipy
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 38 |
|
| 39 |
# 4. Create a non-root user
|
|
@@ -57,7 +62,7 @@ from PIL import Image, ImageDraw
|
|
| 57 |
from llama_cpp import Llama
|
| 58 |
|
| 59 |
# ============================================================================
|
| 60 |
-
# 1. FRONTEND ASSET
|
| 61 |
# ============================================================================
|
| 62 |
|
| 63 |
HTML_TEMPLATE = r"""
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# 1. Install System Dependencies
|
| 8 |
+
# ADDED: 'cmake' is strictly required.
|
| 9 |
+
# We also keep 'build-essential' for other potential compilation needs.
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
git \
|
| 12 |
curl \
|
|
|
|
| 18 |
RUN curl -L -o /app/VT323.ttf https://github.com/google/fonts/raw/main/ofl/vt323/VT323-Regular.ttf
|
| 19 |
|
| 20 |
# 3. Install Python Dependencies
|
| 21 |
+
# CHANGED: Split installation into two steps to prevent hangs.
|
| 22 |
+
|
| 23 |
+
# Step A: Install standard libraries
|
| 24 |
RUN pip install --no-cache-dir \
|
| 25 |
torch \
|
| 26 |
torchvision \
|
|
|
|
| 34 |
pillow \
|
| 35 |
diskcache \
|
| 36 |
safetensors \
|
| 37 |
+
scipy
|
| 38 |
+
|
| 39 |
+
# Step B: Install llama-cpp-python using PRE-BUILT WHEELS.
|
| 40 |
+
# This avoids the "Building wheel..." infinite loop.
|
| 41 |
+
RUN pip install llama-cpp-python \
|
| 42 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 43 |
|
| 44 |
# 4. Create a non-root user
|
|
|
|
| 62 |
from llama_cpp import Llama
|
| 63 |
|
| 64 |
# ============================================================================
|
| 65 |
+
# 1. FRONTEND ASSET
|
| 66 |
# ============================================================================
|
| 67 |
|
| 68 |
HTML_TEMPLATE = r"""
|