Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -38,6 +38,8 @@ RUN apt-get update && apt-get install -y \
|
|
| 38 |
# libcudnn8-dev=${CUDNN_VERSION}.*-1+cuda${CUDA_VERSION} \
|
| 39 |
# && rm -rf /var/lib/apt/lists/*
|
| 40 |
# RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
|
|
|
|
|
|
|
| 41 |
# ENV USE_GPU=true
|
| 42 |
# --- END OPTIONAL CUDA/GPU Installation ---
|
| 43 |
|
|
@@ -53,10 +55,9 @@ COPY app.py .
|
|
| 53 |
# Expose the port Flask runs on
|
| 54 |
EXPOSE 5000
|
| 55 |
|
| 56 |
-
# Set
|
| 57 |
-
# If you
|
| 58 |
-
|
| 59 |
-
ENV USE_GPU=false # Set to 'true' if you uncommented the CUDA/PyTorch installation above
|
| 60 |
|
| 61 |
# Command to run the Flask application using gunicorn for production serving.
|
| 62 |
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
|
|
|
|
| 38 |
# libcudnn8-dev=${CUDNN_VERSION}.*-1+cuda${CUDA_VERSION} \
|
| 39 |
# && rm -rf /var/lib/apt/lists/*
|
| 40 |
# RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
|
| 41 |
+
#
|
| 42 |
+
# If you uncommented the CUDA/PyTorch installation above, set this to 'true'.
|
| 43 |
# ENV USE_GPU=true
|
| 44 |
# --- END OPTIONAL CUDA/GPU Installation ---
|
| 45 |
|
|
|
|
| 55 |
# Expose the port Flask runs on
|
| 56 |
EXPOSE 5000
|
| 57 |
|
| 58 |
+
# Set USE_GPU environment variable for CPU-only deployment.
|
| 59 |
+
# If you enable the OPTIONAL CUDA/GPU section above, ensure ENV USE_GPU=true is set there.
|
| 60 |
+
ENV USE_GPU=false
|
|
|
|
| 61 |
|
| 62 |
# Command to run the Flask application using gunicorn for production serving.
|
| 63 |
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
|