| FROM python:3.10-slim |
|
|
| ENV PYTHONDONTWRITEBYTECODE=1 |
| ENV PYTHONUNBUFFERED=1 |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y libsndfile1 ffmpeg && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| RUN python3 -c "from huggingface_hub import hf_hub_download; \ |
| hf_hub_download(repo_id='Hammad712/pakistani-lid-v3-sota', filename='pakistani_lid_v3.onnx.data', local_dir='/app/local_model', local_dir_use_symlinks=False); \ |
| hf_hub_download(repo_id='Hammad712/pakistani-lid-v3-sota', filename='pakistani_lid_v3.onnx', local_dir='/app/local_model', local_dir_use_symlinks=False)" |
|
|
| EXPOSE 7860 |
|
|
| |
| CMD ["gunicorn", "app:app", "--workers", "1", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "--timeout", "300"] |