Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| ENV PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/data/hf \ | |
| TOKENIZERS_PARALLELISM=false \ | |
| PYTHONUNBUFFERED=1 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| # 1) Instala torch CPU explícitamente | |
| RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.1.0 | |
| # 2) Resto de dependencias | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copia tu código | |
| COPY app ./app | |
| COPY model ./model | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |