Spaces:
Configuration error
Configuration error
# Use Python 3.10.13 as the base image | |
FROM python:3.10.13-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Upgrade pip, install git, MeCab and its dependencies | |
RUN apt-get update \ | |
&& apt-get install -y git mecab libmecab-dev mecab-ipadic mecab-ipadic-utf8 \ | |
&& pip install --upgrade pip | |
# Install PyTorch | |
# Note: Replace the next line with the correct command to install the PyTorch version compatible with your deepspeed version | |
RUN pip install torch | |
# Install other dependencies from requirements.txt | |
COPY requirements.txt /app/ | |
RUN pip install --no-cache-dir -r requirements.txt | |
# List installed packages for debugging | |
RUN pip list | |
# Copy the rest of your application's code | |
COPY . /app/ | |
# Replace the librosa notation.py with notation.py from your project | |
COPY notation.py /usr/local/lib/python3.10/site-packages/librosa/core/notation.py | |
COPY audio.py /usr/local/lib/python3.10/site-packages/librosa/core/audio.py | |
COPY constantq.py /usr/local/lib/python3.10/site-packages/librosa/core/constantq.py | |
COPY filters.py /usr/local/lib/python3.10/site-packages/librosa/filters.py | |
COPY sequence.py /usr/local/lib/python3.10/site-packages/librosa/sequence.py | |
COPY utils.py /usr/local/lib/python3.10/site-packages/librosa/feature/utils.py | |
COPY utils/utils.py /usr/local/lib/python3.10/site-packages/librosa/util/utils.py | |
COPY matching.py /usr/local/lib/python3.10/site-packages/librosa/util/matching.py | |
COPY spectrum.py /usr/local/lib/python3.10/site-packages/librosa/core/spectrum.py | |
COPY pitch.py /usr/local/lib/python3.10/site-packages/librosa/core/pitch.py | |
# RUN cd /tmp && mkdir cache1 | |
ENV NUMBA_CACHE_DIR=/tmp | |
# Expose the port your app runs on | |
EXPOSE 7860 | |
# Download UniDic for MeCab | |
RUN pip install unidic \ | |
&& python -m unidic download | |
# Set the environment variable for Coqui TTS | |
ENV COQUI_TOS_AGREED=1 | |
# Apply migrations | |
RUN python manage.py migrate | |
# Use Django's built-in server to serve the app | |
CMD ["python", "manage.py", "runserver", "0.0.0.0:7860"] | |