Vdphacker commited on
Commit
fe40f3e
·
verified ·
1 Parent(s): 6ae8473

Upload 2 files

Browse files
Files changed (2) hide show
  1. dockerfile +24 -0
  2. requirements_space.txt +16 -0
dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Installer les dépendances système
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ build-essential \
8
+ curl \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copier les fichiers
12
+ COPY . .
13
+
14
+ # Installer les dépendances Python SANS laisser Hugging Face imposer Gradio
15
+ RUN pip install --no-cache-dir -r requirements_space.txt
16
+
17
+ # Télécharger les poids du modèle à l’avance (optionnel mais utile)
18
+ RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \
19
+ AutoTokenizer.from_pretrained('mistralai/Mistral-7B-Instruct-v0.3'); \
20
+ AutoModelForCausalLM.from_pretrained('mistralai/Mistral-7B-Instruct-v0.3', \
21
+ load_in_4bit=True, device_map='auto', trust_remote_code=True)" || true
22
+
23
+ # Lancer l’appli
24
+ CMD ["python", "app.py"]
requirements_space.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ gradio==4.35.0
2
+ langchain==0.2.11
3
+ langchain-community==0.2.10
4
+ langchain-core==0.2.23
5
+ chromadb==0.4.24
6
+ sentence-transformers==3.0.1
7
+ torch==2.4.0
8
+ transformers==4.43.0
9
+ accelerate==0.33.0
10
+ bitsandbytes==0.43.3
11
+ beautifulsoup4==4.12.3
12
+ trafilatura==1.10.1
13
+ unstructured==0.15.2
14
+ lxml==4.9.4
15
+ requests==2.32.3
16
+ huggingface-hub==0.23.5