Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +2 -50
Dockerfile
CHANGED
|
@@ -1,41 +1,3 @@
|
|
| 1 |
-
# FROM nvidia/cuda:12.1.0-base-ubuntu22.04
|
| 2 |
-
|
| 3 |
-
# # Install system dependencies
|
| 4 |
-
# RUN apt-get update && apt-get install -y \
|
| 5 |
-
# python3.10 \
|
| 6 |
-
# python3-pip \
|
| 7 |
-
# git \
|
| 8 |
-
# && rm -rf /var/lib/apt/lists/*
|
| 9 |
-
|
| 10 |
-
# WORKDIR /app
|
| 11 |
-
|
| 12 |
-
# # Create cache directory
|
| 13 |
-
# RUN mkdir -p /.cache/huggingface && \
|
| 14 |
-
# chmod -R 777 /.cache
|
| 15 |
-
|
| 16 |
-
# # Create Streamlit config directory
|
| 17 |
-
# RUN mkdir -p /app/.streamlit
|
| 18 |
-
|
| 19 |
-
# # Install chandra-ocr
|
| 20 |
-
# RUN pip3 install --no-cache-dir chandra-ocr
|
| 21 |
-
|
| 22 |
-
# # Expose port
|
| 23 |
-
# EXPOSE 7860
|
| 24 |
-
|
| 25 |
-
# # Environment variables
|
| 26 |
-
# ENV STREAMLIT_SERVER_PORT=7860
|
| 27 |
-
# ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 28 |
-
# ENV STREAMLIT_SERVER_HEADLESS=true
|
| 29 |
-
# ENV HF_HOME=/.cache/huggingface
|
| 30 |
-
# ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
| 31 |
-
# ENV HF_DATASETS_CACHE=/.cache/huggingface
|
| 32 |
-
|
| 33 |
-
# # Copy Streamlit config (will be available from the repo)
|
| 34 |
-
# COPY .streamlit/config.toml /app/.streamlit/config.toml
|
| 35 |
-
|
| 36 |
-
# # Run the app
|
| 37 |
-
# CMD ["python3", "-m", "streamlit", "run", "/usr/local/lib/python3.10/dist-packages/chandra/scripts/app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 38 |
-
|
| 39 |
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
|
| 40 |
|
| 41 |
# Install system dependencies
|
|
@@ -60,27 +22,17 @@ RUN pip3 install --no-cache-dir chandra-ocr
|
|
| 60 |
# Expose port
|
| 61 |
EXPOSE 7860
|
| 62 |
|
| 63 |
-
# Environment variables
|
| 64 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 65 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 66 |
ENV STREAMLIT_SERVER_HEADLESS=true
|
| 67 |
-
|
| 68 |
-
# HuggingFace cache
|
| 69 |
ENV HF_HOME=/.cache/huggingface
|
| 70 |
ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
| 71 |
ENV HF_DATASETS_CACHE=/.cache/huggingface
|
| 72 |
|
| 73 |
-
#
|
| 74 |
-
ENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 75 |
-
ENV CUDA_LAUNCH_BLOCKING=0
|
| 76 |
-
|
| 77 |
-
# Load model in 8-bit precision to save memory
|
| 78 |
-
ENV MODEL_PRECISION=8bit
|
| 79 |
-
|
| 80 |
COPY .streamlit/config.toml /app/.streamlit/config.toml
|
| 81 |
|
| 82 |
-
|
| 83 |
# Run the app
|
| 84 |
CMD ["python3", "-m", "streamlit", "run", "/usr/local/lib/python3.10/dist-packages/chandra/scripts/app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 85 |
|
| 86 |
-
# CMD ["python3", "-m", "streamlit", "run", "/usr/local/lib/python3.10/dist-packages/chandra/scripts/app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false", "--server.enableCORS=false"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
|
| 2 |
|
| 3 |
# Install system dependencies
|
|
|
|
| 22 |
# Expose port
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
# Environment variables
|
| 26 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 27 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 28 |
ENV STREAMLIT_SERVER_HEADLESS=true
|
|
|
|
|
|
|
| 29 |
ENV HF_HOME=/.cache/huggingface
|
| 30 |
ENV TRANSFORMERS_CACHE=/.cache/huggingface
|
| 31 |
ENV HF_DATASETS_CACHE=/.cache/huggingface
|
| 32 |
|
| 33 |
+
# Copy Streamlit config (will be available from the repo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
COPY .streamlit/config.toml /app/.streamlit/config.toml
|
| 35 |
|
|
|
|
| 36 |
# Run the app
|
| 37 |
CMD ["python3", "-m", "streamlit", "run", "/usr/local/lib/python3.10/dist-packages/chandra/scripts/app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 38 |
|
|
|