Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -1,21 +1,24 @@
|
|
| 1 |
-
#
|
|
|
|
| 2 |
FROM python:3.10
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
# This
|
| 8 |
-
RUN pip install --
|
| 9 |
-
|
| 10 |
|
| 11 |
-
# Install your other
|
| 12 |
COPY requirements.txt .
|
| 13 |
-
RUN pip install -r requirements.txt
|
| 14 |
|
| 15 |
-
# Copy your code
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
-
#
|
| 19 |
EXPOSE 7860
|
| 20 |
|
|
|
|
| 21 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# We use 'python:3.10' instead of 'slim' because the standard version
|
| 2 |
+
# already has most tools installed, so we don't have to wait for 'apt-get'.
|
| 3 |
FROM python:3.10
|
| 4 |
|
| 5 |
+
# Set a working directory
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Step 1: Install llama-cpp-python using the PRE-COMPILED link.
|
| 9 |
+
# This is the "Magic Trick" to skip the 15-minute build.
|
| 10 |
+
RUN pip install --no-cache-dir llama-cpp-python \
|
| 11 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 12 |
|
| 13 |
+
# Step 2: Install your other requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
# Step 3: Copy your code
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
+
# Hugging Face Spaces must run on port 7860
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# Run your app
|
| 24 |
CMD ["python", "app.py"]
|