|
FROM python:3.10 |
|
ENV HF_HOME=/app/hf_cache |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
gcc \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
RUN mkdir -p /app/hf_cache |
|
|
|
WORKDIR /app |
|
|
|
COPY requirements.txt . |
|
RUN pip install -r requirements.txt |
|
|
|
RUN python -c "from transformers import AutoModelForCausalLM, AutoTokenizer; AutoModelForCausalLM.from_pretrained('Locutusque/TinyMistral-248M'); AutoTokenizer.from_pretrained('Locutusque/TinyMistral-248M')" |
|
|
|
COPY . . |
|
|
|
EXPOSE 7860 |
|
|
|
CMD ["python", "app.py"] |