jwphantom commited on
Commit
f054abb
1 Parent(s): 503c42b

fix problem get_relevant_documents

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -1,5 +1,12 @@
1
  # Étape de build
2
- FROM python:3.11 as builder
 
 
 
 
 
 
 
3
 
4
  WORKDIR /app
5
 
@@ -10,9 +17,12 @@ COPY requirements.txt .
10
  RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
11
 
12
  # Étape finale
13
- FROM python:3.11
14
 
 
15
  ENV CUDA_VISIBLE_DEVICES=""
 
 
16
  ENV TF_FORCE_CPU_ALLOW_GROWTH=true
17
  ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
18
 
@@ -41,4 +51,4 @@ USER appuser
41
 
42
  EXPOSE 8080
43
 
44
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Étape de build
2
+ FROM python:3.11-slim as builder
3
+
4
+ # Définir des variables d'environnement pour désactiver CUDA et forcer le mode CPU
5
+ ENV CUDA_VISIBLE_DEVICES=""
6
+ ENV TRANSFORMERS_OFFLINE=1
7
+ ENV HF_DATASETS_OFFLINE=1
8
+ ENV TF_FORCE_CPU_ALLOW_GROWTH=true
9
+ ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
10
 
11
  WORKDIR /app
12
 
 
17
  RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
18
 
19
  # Étape finale
20
+ FROM python:3.11-slim
21
 
22
+ # Redéfinir les variables d'environnement dans l'image finale
23
  ENV CUDA_VISIBLE_DEVICES=""
24
+ ENV TRANSFORMERS_OFFLINE=1
25
+ ENV HF_DATASETS_OFFLINE=1
26
  ENV TF_FORCE_CPU_ALLOW_GROWTH=true
27
  ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
28
 
 
51
 
52
  EXPOSE 8080
53
 
54
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]