Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
WORKDIR /app | |
ENV HF_HOME=/data/hf_cache | |
ENV HF_DATASETS_CACHE=/data/hf_cache | |
RUN mkdir -p /data/hf_cache && chmod -R 777 /data/hf_cache | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
RUN python - <<'PY' | |
from transformers import T5Tokenizer, T5ForConditionalGeneration | |
T5Tokenizer.from_pretrained("t5-small", cache_dir="/data/hf_cache") | |
T5ForConditionalGeneration.from_pretrained("t5-small", cache_dir="/data/hf_cache") | |
PY | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |