Sidoineko commited on
Commit
7c5d357
·
1 Parent(s): 1f7bdfa

Mise à jour du Dockerfile et des dépendances pour Hugging Face Spaces

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -15
  2. requirements.txt +10 -6
Dockerfile CHANGED
@@ -2,34 +2,25 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # 1. Mise à jour de pip seule
6
- RUN pip install --upgrade pip
7
-
8
- # 2. Installation des dépendances système
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # 3. Installation des dépendances Python
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # 4. Installation de PyTorch séparément avec timeout augmenté
18
- RUN pip install --no-cache-dir --timeout=600 \
19
- torch==2.0.1+cpu \
20
- torchvision==0.15.2+cpu \
21
- -f https://download.pytorch.org/whl/torch_stable.html
22
-
23
- # 5. Copie du code
24
  COPY . .
25
 
26
- # Configuration Streamlit
27
  ENV STREAMLIT_SERVER_PORT=8501
28
  ENV STREAMLIT_SERVER_HEADLESS=true
29
  ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
30
 
31
- # Port exposé
32
- EXPOSE 8501
33
 
34
  # Commande de démarrage
35
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Installation des dépendances système
 
 
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Copie des requirements d'abord pour le cache Docker
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Copie du code source
 
 
 
 
 
 
15
  COPY . .
16
 
17
+ # Configuration des variables d'environnement
18
  ENV STREAMLIT_SERVER_PORT=8501
19
  ENV STREAMLIT_SERVER_HEADLESS=true
20
  ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
21
 
22
+ # Se déplacer dans le dossier src
23
+ WORKDIR /app/src
24
 
25
  # Commande de démarrage
26
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
requirements.txt CHANGED
@@ -1,6 +1,10 @@
1
- streamlit>=1.28.0
2
- transformers>=4.53.0
3
- torch>=2.0.0
4
- pillow>=10.0.0
5
- huggingface-hub>=0.19.0
6
- accelerate>=0.25.0
 
 
 
 
 
1
+ streamlit==1.28.0
2
+ transformers==4.36.2
3
+ torch==2.0.1
4
+ torchvision==0.15.2
5
+ pillow==10.0.0
6
+ huggingface-hub==0.19.4
7
+ accelerate==0.25.0
8
+ fastapi==0.104.1
9
+ uvicorn==0.24.0
10
+ python-multipart==0.0.6