ShadowTEM commited on
Commit
b2b95bd
·
verified ·
1 Parent(s): 56cd376

added wget so they download the model

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -6
Dockerfile CHANGED
@@ -4,30 +4,36 @@ FROM python:3.12.8
4
  ENV PYTHONUNBUFFERED=1
5
  ENV HF_HOME=/app/.huggingface_cache
6
 
7
- # Create directories for the Hugging Face cache and the VectorDB
8
- RUN mkdir -p /app/.huggingface_cache /app/VectorDB
9
 
10
- # Install dependencies
11
  RUN apt-get update && apt-get install -y \
12
  python3-pip \
13
  python3-dev \
14
  libatlas-base-dev \
 
15
  && pip install --no-cache-dir --upgrade pip
16
 
 
 
 
 
17
  # Set the working directory in the container
18
  WORKDIR /app
19
 
 
20
  COPY requirements.txt .
21
  RUN pip install -r requirements.txt
22
 
23
  # Copy the current directory contents into the container
24
  COPY . /app/
25
 
26
- # Set the appropriate permissions for the cache and vectorstore directories
27
- RUN chmod -R 777 /app/.huggingface_cache /app/VectorDB
28
 
29
  # Expose the port the app runs on
30
  EXPOSE 7860
31
 
32
  # Run the application
33
- CMD ["python", "app.py"]
 
4
  ENV PYTHONUNBUFFERED=1
5
  ENV HF_HOME=/app/.huggingface_cache
6
 
7
+ # Create directories for the Hugging Face cache, VectorDB, and models
8
+ RUN mkdir -p /app/.huggingface_cache /app/VectorDB /app/models
9
 
10
+ # Install dependencies including wget for downloading model files
11
  RUN apt-get update && apt-get install -y \
12
  python3-pip \
13
  python3-dev \
14
  libatlas-base-dev \
15
+ wget \
16
  && pip install --no-cache-dir --upgrade pip
17
 
18
+ # Download the ONNX model file and voices file (adjust URLs if necessary)
19
+ RUN wget -O /app/models/kokoro-v1.0.fp16-gpu.onnx https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/kokoro-v1.0.fp16-gpu.onnx \
20
+ && wget -O /app/models/voices.json https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin
21
+
22
  # Set the working directory in the container
23
  WORKDIR /app
24
 
25
+ # Copy and install Python dependencies
26
  COPY requirements.txt .
27
  RUN pip install -r requirements.txt
28
 
29
  # Copy the current directory contents into the container
30
  COPY . /app/
31
 
32
+ # Set appropriate permissions for the cache, vectorstore, and models directories
33
+ RUN chmod -R 777 /app/.huggingface_cache /app/VectorDB /app/models
34
 
35
  # Expose the port the app runs on
36
  EXPOSE 7860
37
 
38
  # Run the application
39
+ CMD ["python", "app.py"]