Spaces:
Sleeping
Sleeping
| FROM python:3.10 as build | |
| RUN apt-get update | |
| RUN mkdir /whisper && \ | |
| wget -q https://github.com/ggerganov/whisper.cpp/tarball/master -O - | \ | |
| tar -xz -C /whisper --strip-components 1 | |
| WORKDIR /whisper | |
| ARG model=small-q5_1 | |
| RUN bash ./models/download-ggml-model.sh "${model}" | |
| RUN make main | |
| FROM python:3.10 as whisper | |
| RUN apt-get update \ | |
| && apt-get install -y libsdl2-dev alsa-utils ffmpeg \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/root | |
| COPY --chown=user requirements.txt $HOME/root | |
| RUN pip install -r $HOME/root/requirements.txt | |
| COPY --chown=user main.py $HOME/root | |
| COPY --chown=user youtubeaudio.py $HOME/root | |
| ARG model=small-q5_1 | |
| ENV model=$model | |
| RUN mkdir $HOME/root/models | |
| RUN mkdir -p -m 775 /tmp/holosubs/tracks /tmp/holosubs/videos | |
| COPY --from=build "/whisper/models/ggml-${model}.bin" "${HOME}/root/models/ggml-${model}.bin" | |
| COPY --from=build /whisper/main /usr/local/bin/whisper | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |