Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| WORKDIR /app | |
| ENV HF_HOME=/tmp/.cache | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Pre-download ASR model | |
| RUN python -c "from transformers import AutoProcessor; from optimum.onnxruntime import ORTModelForSpeechSeq2Seq; AutoProcessor.from_pretrained('openai/whisper-base'); ORTModelForSpeechSeq2Seq.from_pretrained('openai/whisper-base', provider='CPUExecutionProvider')" | |
| # Pre-download Translation models | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-en-zh')" | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-zh-en')" | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='staka/fugumt-en-ja')" | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-ja-en')" | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-tc-big-en-ko')" | |
| RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-ko-en')" | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |