CoolFace
Apppublic

melbinjp/DocQA

sourceHugging Faceupdated 25d agoView on Hugging Face
0likes
Dockerfile21 linesDownload Raw Back to root
1FROM python:3.10-slim2WORKDIR /app3 4# install torch first so that subsequent deps see it already resolved5COPY requirements.txt ./6# The CPU index no longer hosts every torch dependency as a wheel, so deps fall7# back to PyPI; torch itself still resolves to the +cpu wheel because a local8# version sorts above the plain release. Pinned at 2.9.1 rather than 2.4.0:9# current transformers only imports torch behind a >=2.5 version guard, so 2.410# dies at import time with "NameError: name 'torch' is not defined".11RUN pip install --no-cache-dir torch==2.9.1 --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple12RUN pip install --no-cache-dir -r requirements.txt13 14 15RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache16ENV HF_HOME=/tmp/hf_cache17ENV HF_HUB_DOWNLOAD_TIMEOUT=12018 19COPY . ./20EXPOSE 786021CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]