Hameed13 commited on
Commit
2f806ee
·
verified ·
1 Parent(s): 0e19a42

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -15
Dockerfile CHANGED
@@ -1,31 +1,45 @@
1
- FROM python:3.10-slim
 
2
 
3
- WORKDIR /code
 
4
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
 
 
 
7
  build-essential \
8
- libsndfile1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create required directories
12
- RUN mkdir -p /code/cache && \
13
- mkdir -p /code/models && \
14
- mkdir -p /code/audio_files && \
15
- chmod -R 777 /code
16
 
17
- # Copy requirements first to leverage Docker cache
18
- COPY ./requirements.txt /code/requirements.txt
19
 
20
  # Install Python dependencies
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy the rest of the application
 
 
 
 
 
 
 
24
  COPY . .
25
 
 
 
 
 
 
 
26
  # Set environment variables
27
- ENV PYTHONPATH=/code
28
- ENV TRANSFORMERS_CACHE=/code/cache
29
- ENV HF_HOME=/code/cache
30
 
31
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use Python 3.9 base image
2
+ FROM python:3.9-slim
3
 
4
+ # Set working directory
5
+ WORKDIR /app
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
+ git \
10
+ wget \
11
+ curl \
12
  build-essential \
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Install gdown for Google Drive downloads
16
+ RUN pip install gdown
 
 
 
17
 
18
+ # Copy requirements first to leverage Docker layer caching
19
+ COPY requirements.txt .
20
 
21
  # Install Python dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
+ # Clone the yarngpt repository
25
+ RUN git clone https://github.com/saheedniyi02/yarngpt.git
26
+
27
+ # Download model files
28
+ RUN wget https://huggingface.co/novateur/WavTokenizer-medium-speech-75token/resolve/main/wavtokenizer_mediumdata_frame75_3s_nq1_code4096_dim512_kmeans200_attn.yaml
29
+ RUN gdown 1-ASeEkrn4HY49yZWHTASgfGFNXdVnLTt
30
+
31
+ # Copy application code
32
  COPY . .
33
 
34
+ # Create audio files directory
35
+ RUN mkdir -p audio_files
36
+
37
+ # Expose port
38
+ EXPOSE 7860
39
+
40
  # Set environment variables
41
+ ENV PYTHONPATH="${PYTHONPATH}:/app"
42
+ ENV HF_HOME="/tmp/huggingface"
 
43
 
44
+ # Run the application
45
+ CMD ["python", "app.py"]