CoolFace
Apppublic

rajraunakkumar0programmer/tokenizer_website

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
Dockerfile25 linesDownload Raw Back to root
1FROM python:3.10-slim2WORKDIR /app3 4# The user will only upload app.zip and this Dockerfile5COPY app.zip .6 7# Install unzip, extract the application, and clean up the zip file8# (also install build-essential for tokenizer dependencies)9RUN apt-get update && apt-get install -y --no-install-recommends \10    unzip \11    build-essential \12    && unzip -o app.zip && rm app.zip \13    && rm -rf /var/lib/apt/lists/*14 15# Install dependencies from the extracted requirements.txt16RUN pip install --no-cache-dir -r requirements.txt17 18# Pre-download the tokenizer during the Docker build (setting cache dir to /app/cache to ensure it persists across users)19ENV HF_HOME=/app/cache20RUN python -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('unsloth/Llama-3.2-3B-Instruct')"21 22EXPOSE 800023# We use --preload so the master process downloads the tokenizer ONCE before forking the workers24CMD ["gunicorn", "--preload", "--timeout", "120", "-w", "4", "-b", "0.0.0.0:8000", "app:app"]25