Spaces:
Running
Running
| FROM python:3.10-slim | |
| WORKDIR /app | |
| ENV HF_HOME=/app/.cache/huggingface | |
| ENV HF_HUB_CACHE=/app/.cache/huggingface/hub | |
| RUN apt-get update | |
| build-essential \ | |
| curl \ | |
| git \ | |
| libxrender1 \ | |
| libxext6 \ | |
| libx11-6 \ | |
| libsm6 \ | |
| libfreetype6 \ | |
| libpng-dev \ | |
| libcairo2 \ | |
| COPY ./requirements.txt requirements.txt | |
| RUN pip install --upgrade pip setuptools wheel \ | |
| RUN python -c "\ | |
| from huggingface_hub import snapshot_download, hf_hub_download; \ | |
| models = { \ | |
| 'cn': 'SalZa2004/Cetane_Number_Predictor', \ | |
| 'ysi': 'SalZa2004/YSI_Predictor', \ | |
| 'bp': 'SalZa2004/Boiling_Point_Predictor', \ | |
| 'density': 'SalZa2004/Density_Predictor', \ | |
| 'lhv': 'SalZa2004/LHV_Predictor', \ | |
| 'dv': 'SalZa2004/Dynamic_Viscosity_Predictor', \ | |
| 'dcn': 'SalZa2004/MolPool_GNN_model', \ | |
| }; \ | |
| [snapshot_download(repo_id=v, repo_type='model') for v in models.values()]; \ | |
| hf_hub_download(repo_id='mrashid26/Biodiesel_CN_Predictor', filename='src/biodiesel_cn_model.pkl', repo_type='space'); \ | |
| hf_hub_download(repo_id='mrashid26/Biodiesel_CN_Predictor', filename='src/ood_stats.pkl', repo_type='space'); \ | |
| print('All models downloaded and cached.')" | |
| COPY . /app | |
| CMD ["gunicorn", "-b", "0.0.0.0:7860", "--workers", "1", "--timeout", "0", "--max-requests", "200", "--max-requests-jitter", "50", "app:app"] | |