Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +6 -14
Dockerfile
CHANGED
|
@@ -1,32 +1,24 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install system dependencies
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
| 5 |
-
build-essential \
|
| 6 |
-
cmake \
|
| 7 |
-
libgomp1 \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
# Upgrade pip
|
| 13 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 14 |
|
| 15 |
-
# Install llama-cpp-python
|
| 16 |
RUN pip install --no-cache-dir llama-cpp-python \
|
| 17 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 18 |
|
| 19 |
# Install web + Hugging Face tools
|
| 20 |
RUN pip install --no-cache-dir flask requests huggingface-hub
|
| 21 |
|
| 22 |
-
# Copy your app
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
# Expose the port
|
| 26 |
EXPOSE 7860
|
| 27 |
-
|
| 28 |
-
# Ensure output is unbuffered
|
| 29 |
ENV PYTHONUNBUFFERED=1
|
| 30 |
|
| 31 |
-
# Run your app
|
| 32 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install minimal system dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y libgomp1 && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Upgrade pip, setuptools, wheel
|
| 9 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 10 |
|
| 11 |
+
# Install llama-cpp-python from prebuilt CPU wheel
|
| 12 |
RUN pip install --no-cache-dir llama-cpp-python \
|
| 13 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 14 |
|
| 15 |
# Install web + Hugging Face tools
|
| 16 |
RUN pip install --no-cache-dir flask requests huggingface-hub
|
| 17 |
|
| 18 |
+
# Copy your app
|
| 19 |
COPY . .
|
| 20 |
|
|
|
|
| 21 |
EXPOSE 7860
|
|
|
|
|
|
|
| 22 |
ENV PYTHONUNBUFFERED=1
|
| 23 |
|
|
|
|
| 24 |
CMD ["python", "app.py"]
|