igmeMarcial commited on
Commit
4ff9d20
·
1 Parent(s): 6cde1a3
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -1,13 +1,19 @@
1
  FROM python:3.12.0
2
 
3
  WORKDIR /app
4
-
5
  COPY requirements.txt .
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
 
 
8
  COPY . .
9
- RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
10
- ENV HUGGINGFACE_HUB_CACHE=/app/.cache
11
 
12
  # Comando para ejecutar el servidor Uvicorn con FastAPI
13
  # Usa 0.0.0.0:7860 porque Spaces mapea el puerto 7860
 
1
  FROM python:3.12.0
2
 
3
  WORKDIR /app
4
+ ENV HUGGINGFACE_HUB_CACHE=/app/.cache
5
  COPY requirements.txt .
6
+
7
+
8
+
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+
12
+ RUN python -c "import os; os.environ['HUGGINGFACE_HUB_CACHE']='/app/.cache'; from transformers import AutoProcessor, AutoModelForVision2Seq; print('Downloading processor...'); AutoProcessor.from_pretrained('HuggingFaceTB/SmolVLM-500M-Instruct'); print('Downloading model...'); AutoModelForVision2Seq.from_pretrained('HuggingFaceTB/SmolVLM-500M-Instruct', low_cpu_mem_usage=True);"
13
+
14
  COPY . .
15
+
16
+
17
 
18
  # Comando para ejecutar el servidor Uvicorn con FastAPI
19
  # Usa 0.0.0.0:7860 porque Spaces mapea el puerto 7860