|
|
|
FROM python:3.8-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
ENV HF_HOME=/app/cache |
|
ENV TRANSFORMERS_CACHE=/app/cache |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN apt-get update && apt-get install -y ffmpeg |
|
|
|
|
|
RUN mkdir -p /app/cache /app/temp && chmod -R 777 /app/cache /app/temp |
|
|
|
|
|
RUN python -c "from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer; \ |
|
M2M100ForConditionalGeneration.from_pretrained('facebook/m2m100_418M', cache_dir='/app/cache'); \ |
|
M2M100Tokenizer.from_pretrained('facebook/m2m100_418M', cache_dir='/app/cache')" && \ |
|
python -c "import whisper; whisper.load_model('turbo', download_root='/app/cache')" |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python","app.py"] |
|
|