Frederic-CellNum commited on
Commit
2d74602
·
verified ·
1 Parent(s): 9ca3e5f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,14 +1,18 @@
1
- FROM tiangolo/uvicorn-gunicorn:python3.11
2
 
3
  WORKDIR /app
4
 
5
- # Copier les fichiers
6
  COPY requirements.txt .
7
- RUN pip install --no-cache-dir -r requirements.txt
8
 
9
- COPY app.py .
 
 
 
 
 
10
 
11
- # Exposer le port
12
- EXPOSE 7860
13
 
14
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11
2
 
3
  WORKDIR /app
4
 
5
+ # Installer les dépendances
6
  COPY requirements.txt .
7
+ RUN pip install -r requirements.txt
8
 
9
+ # Pré-télécharger le modèle PENDANT le build (accès réseau autorisé)
10
+ RUN python -c "
11
+ from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
12
+ AutoProcessor.from_pretrained('Qwen/Qwen2-VL-7B-Instruct')
13
+ Qwen2VLForConditionalGeneration.from_pretrained('Qwen/Qwen2-VL-7B-Instruct', torch_dtype='auto')
14
+ "
15
 
16
+ COPY . .
 
17
 
18
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]