Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -8
Dockerfile
CHANGED
|
@@ -1,23 +1,30 @@
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
build-essential \
|
| 5 |
-
cmake \
|
| 6 |
-
ninja-build \
|
| 7 |
git \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
RUN pip install --upgrade pip
|
| 11 |
|
| 12 |
-
|
|
|
|
| 13 |
fastapi \
|
| 14 |
uvicorn \
|
| 15 |
-
huggingface_hub
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 20 |
WORKDIR /app
|
| 21 |
-
COPY app.py /app.py
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
+
# Minimal system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential \
|
|
|
|
|
|
|
| 6 |
git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 10 |
|
| 11 |
+
# Install regular dependencies
|
| 12 |
+
RUN pip install --no-cache-dir \
|
| 13 |
fastapi \
|
| 14 |
uvicorn \
|
| 15 |
+
huggingface_hub \
|
| 16 |
+
pydantic
|
| 17 |
|
| 18 |
+
# Install PRE-COMPILED llama-cpp-python for CPU
|
| 19 |
+
# This prevents the "Job timeout" by skipping the build phase
|
| 20 |
+
RUN pip install llama-cpp-python \
|
| 21 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 22 |
|
| 23 |
+
# Set working directory
|
| 24 |
WORKDIR /app
|
|
|
|
| 25 |
|
| 26 |
+
# Copy your application code
|
| 27 |
+
COPY app.py .
|
| 28 |
+
|
| 29 |
+
# Run the API
|
| 30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|