Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
WORKDIR /app | |
ENV HF_HOME=/app/.cache/huggingface | |
ENV XDG_CACHE_HOME=/app/.cache | |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
# (Optional) pre-download model to image to avoid runtime download | |
# RUN python -c "from transformers import AutoModelForCausalLM, AutoTokenizer; m='google/gemma-2-2b-it'; AutoTokenizer.from_pretrained(m); AutoModelForCausalLM.from_pretrained(m)" | |
EXPOSE 7860 | |
CMD ["python", "main.py"] | |