File size: 1,267 Bytes
187a7a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4c98b4c
 
 
 
 
 
 
187a7a3
 
9294053
187a7a3
 
 
 
9294053
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
FROM python:3.10-slim

# ffmpeg is required at runtime: the browser records audio in whatever codec
# MediaRecorder produces (typically webm/opus), and app.py shells out to
# ffmpeg to convert it to 16kHz mono WAV before ASR inference.
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    libsndfile1 \
    git \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

ENV PORT=7860
# Same fix applied in the training/probing notebooks earlier in this project:
# a broken numba-cuda shim can crash `import nemo.collections.asr` with an
# unrelated "numba.cuda.types has no attribute NPDatetime" error. NeMo doesn't
# need numba's CUDA-JIT target for inference (GPU tensor ops go through
# PyTorch/CUDA directly), so disabling it here is a safe, cheap guard against
# that entire class of failure inside the container too.
ENV NUMBA_DISABLE_CUDA=1
EXPOSE 7860

RUN mkdir -p /app/results && chmod -R 777 /app/results

# Single worker: app.py keeps session state in an in-memory dict (see its
# docstring). Do not scale this to multiple gunicorn workers without first
# moving session state to a shared store (Redis, a database, etc).
CMD ["python", "app.py"]