Spaces:
Sleeping
Sleeping
FROM python:3.12.0 | |
WORKDIR /app | |
ENV HUGGINGFACE_HUB_CACHE=/app/.cache | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
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);" | |
COPY . . | |
# Comando para ejecutar el servidor Uvicorn con FastAPI | |
# Usa 0.0.0.0:7860 porque Spaces mapea el puerto 7860 | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860","--root-path", "/"] |