AnyaSchen commited on
Commit
20abd1e
·
1 Parent(s): 6552e34

try to use cuda

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,10 +1,13 @@
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.10-slim
5
 
6
- # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
 
 
 
8
  build-essential \
9
  git \
10
  curl \
@@ -25,7 +28,7 @@ ENV PATH="/home/user/.local/bin:$PATH"
25
 
26
  # Copy requirements first to leverage Docker cache
27
  COPY --chown=user requirements.txt .
28
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
29
 
30
  # Copy application files
31
  COPY --chown=user *.py /app/
@@ -36,9 +39,12 @@ COPY --chown=user static /app/static/
36
  # Set environment variables
37
  ENV PYTHONPATH=/app
38
  ENV PYTHONUNBUFFERED=1
 
 
 
39
 
40
  # Expose the port the server runs on
41
  EXPOSE 7860
42
 
43
  # Run the server using main.py
44
- CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "7860", "--model", "tiny", "--backend", "faster-whisper", "--task", "transcribe"]
 
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
+ FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
5
 
6
+ # Install Python and system dependencies
7
  RUN apt-get update && apt-get install -y \
8
+ python3.10 \
9
+ python3.10-dev \
10
+ python3-pip \
11
  build-essential \
12
  git \
13
  curl \
 
28
 
29
  # Copy requirements first to leverage Docker cache
30
  COPY --chown=user requirements.txt .
31
+ RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
32
 
33
  # Copy application files
34
  COPY --chown=user *.py /app/
 
39
  # Set environment variables
40
  ENV PYTHONPATH=/app
41
  ENV PYTHONUNBUFFERED=1
42
+ ENV CUDA_HOME=/usr/local/cuda
43
+ ENV PATH=${CUDA_HOME}/bin:${PATH}
44
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
45
 
46
  # Expose the port the server runs on
47
  EXPOSE 7860
48
 
49
  # Run the server using main.py
50
+ CMD ["python3", "main.py", "--host", "0.0.0.0", "--port", "7860", "--model", "base", "--backend", "faster-whisper", "--task", "transcribe"]