api_sparrow_ocr / Dockerfile
Frederic-CellNum's picture
Update Dockerfile
6ae3c94 verified
raw
history blame
550 Bytes
FROM python:3.11
WORKDIR /app
# Installer les dépendances
COPY requirements.txt .
RUN pip install -r requirements.txt
# Pré-télécharger le modèle PENDANT le build (accès réseau autorisé)
RUN python -c "from transformers import Qwen2VLForConditionalGeneration, AutoProcessor"
RUN python -c "AutoProcessor.from_pretrained('Qwen/Qwen2-VL-7B-Instruct')"
RUN python -c "Qwen2VLForConditionalGeneration.from_pretrained('Qwen/Qwen2-VL-7B-Instruct', torch_dtype='auto')"
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]