Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +0 -20
Dockerfile
CHANGED
|
@@ -1,31 +1,11 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
-
|
| 4 |
-
# Set the working directory in the container
|
| 5 |
WORKDIR /code
|
| 6 |
-
|
| 7 |
-
# Set cache directory to a universally writable temp location
|
| 8 |
ENV HF_HOME /tmp/cache
|
| 9 |
ENV TRANSFORMERS_CACHE /tmp/cache
|
| 10 |
ENV HF_HUB_CACHE /tmp/cache
|
| 11 |
-
|
| 12 |
-
# Update package lists and install git
|
| 13 |
RUN apt-get update && apt-get install -y git
|
| 14 |
-
|
| 15 |
-
# === THIS LINE IS NOW FIXED ===
|
| 16 |
-
# Install torch, torchvision, AND transformers from GitHub
|
| 17 |
-
RUN pip install --no-cache-dir torch torchvision git+https://github.com/huggingface/transformers
|
| 18 |
-
# ===============================
|
| 19 |
-
|
| 20 |
-
# Copy and install the rest of your requirements
|
| 21 |
COPY requirements.txt .
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
-
|
| 24 |
-
# Copy the rest of your app's code
|
| 25 |
COPY . .
|
| 26 |
-
|
| 27 |
-
# Tell Docker what port the app will run on
|
| 28 |
EXPOSE 7860
|
| 29 |
-
|
| 30 |
-
# Command to run your app
|
| 31 |
CMD ["python", "app.py"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
|
|
|
| 2 |
WORKDIR /code
|
|
|
|
|
|
|
| 3 |
ENV HF_HOME /tmp/cache
|
| 4 |
ENV TRANSFORMERS_CACHE /tmp/cache
|
| 5 |
ENV HF_HUB_CACHE /tmp/cache
|
|
|
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 9 |
COPY . .
|
|
|
|
|
|
|
| 10 |
EXPOSE 7860
|
|
|
|
|
|
|
| 11 |
CMD ["python", "app.py"]
|