Spaces:
Runtime error
Runtime error
File size: 1,583 Bytes
bcc44ab ae68666 9a42fe1 ae68666 6c2f106 bcc44ab 7a8fb0f bcc44ab fb4654c 6c2f106 9a42fe1 fb4654c 6c2f106 fb4654c ae68666 6c2f106 fb4654c ae68666 abeb8cb c08ad6c 7a8fb0f 877a3f9 abeb8cb 877a3f9 abeb8cb 7a8fb0f 877a3f9 6c2f106 9a42fe1 fb4654c ae68666 877a3f9 9a42fe1 ae68666 877a3f9 7a8fb0f |
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 44 45 46 47 48 49 |
# Use an official Python runtime as a base image
FROM python:3.10
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y ffmpeg libsndfile1 && \
rm -rf /var/lib/apt/lists/*
# Copy the requirements file and install Python dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Clone the necessary external repositories
RUN git clone https://github.com/reazon-research/ReazonSpeech /app/ReazonSpeech
# Install local packages from the cloned repository
RUN pip install --no-warn-conflicts /app/ReazonSpeech/pkg/nemo-asr
RUN pip install /app/ReazonSpeech/pkg/nemo-asr
# Create directories for caches and set permissions
RUN mkdir -p /app/cache/huggingface /app/cache/modelscope /app/cache/matplotlib /app/cache/fontconfig /app/cache/lhotse && \
chmod -R 777 /app/cache
# Set environment variables for cache directories and application configuration
ENV TRANSFORMERS_CACHE=/app/cache/huggingface
ENV HF_HOME=/app/cache/huggingface
ENV MODELSCOPE_CACHE=/app/cache/modelscope
ENV MPLCONFIGDIR=/app/cache/matplotlib
ENV FONTCONFIG_PATH=/app/cache/fontconfig
ENV LHOTSE_CACHE=/app/cache/lhotse
ENV PYTHONUNBUFFERED=1
# Copy the rest of the application source code
COPY . /app
# Expose the port the app runs on
EXPOSE 7860
# Define environment variables for the Uvicorn command if necessary
ENV MODULE_NAME="app.main"
ENV VARIABLE_NAME="app"
ENV PORT=7860
# Run the app using Uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|