tokenizers / Dockerfile
Nymbo's picture
Stop segfaulting on tokenizer preload failure; ungated tokenizer mirrors; anonymous retry; python 3.12 non-root image
47bb43f verified
Raw History Blame Contribute Delete
455 Bytes
FROM python:3.12-slim
# Install dependencies (tokenizers only; no torch needed)
RUN pip install --no-cache-dir flask "transformers>=5" sentencepiece protobuf
# Run as the non-root user HF Spaces expects
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
HF_HOME=/tmp/huggingface
WORKDIR /home/user/app
COPY --chown=user . /home/user/app
# Expose the port for the app
EXPOSE 7860
# Command to run app.py directly
CMD ["python", "app.py"]