File size: 1,341 Bytes
e5b72ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c12c9ce
e5b72ea
 
 
 
 
 
 
 
 
515828c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Use the specified RunPod base image with CUDA support and Python 3.8
FROM python:3.8-slim

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    python3-dev \
    ffmpeg \
    aria2 \
    git \
    git-lfs \
    && rm -rf /var/lib/apt/lists/*

# Clone the repository into the container
ARG CACHEBUST=1
RUN git clone https://huggingface.co/spaces/smjain/Advanced-RVC-Inference /app

# Set the working directory to the cloned repository to run commands inside it
WORKDIR /app

# Install Git Large File Storage (LFS), then pull LFS files
RUN git lfs install && git lfs pull

# Create a virtual environment named 'infer' and activate it
#RUN python3 -m venv /venv/infer
#ENV PATH="/venv/infer/bin:$PATH"

# Upgrade pip and install Python dependencies from the project's requirements.txt
# Also, install Flask and av as specified
RUN pip install --upgrade pip && \
    pip install --upgrade -r requirements.txt --no-cache-dir && \
    pip install flask av boto3 flask_dance runpod

# Move PyTorch model weights into the weights directory if necessary
RUN mv *.pth weights/ || echo "No weights to move"

# Setting Flask application
# Expose the port Flask is running on
EXPOSE 5000

# Command to directly run the Flask application script
CMD ["python", "infer_serverless.py"]