Nexari-Research commited on
Commit
cda338b
·
verified ·
1 Parent(s): 9513566

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /code
4
 
5
- # Install system deps
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential git curl && rm -rf /var/lib/apt/lists/*
8
 
@@ -10,15 +10,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
10
  RUN pip install --no-cache-dir --upgrade pip
11
  RUN pip install --no-cache-dir fastapi uvicorn transformers torch accelerate gradio spaces textblob pytz duckduckgo-search wikipedia scikit-learn
12
 
13
- # Download TextBlob corpora
14
  RUN python -m textblob.download_corpora lite
15
 
16
- # Pre-download support models
17
  RUN python -c "from transformers import pipeline; pipeline('zero-shot-classification', model='typeform/distilbert-base-uncased-mnli')"
 
18
 
19
- # Copy application files
20
  COPY . .
21
 
22
  RUN chmod -R 755 .
23
 
24
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /code
4
 
5
+ # Install system deps for some transformers backends (optional)
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential git curl && rm -rf /var/lib/apt/lists/*
8
 
 
10
  RUN pip install --no-cache-dir --upgrade pip
11
  RUN pip install --no-cache-dir fastapi uvicorn transformers torch accelerate gradio spaces textblob pytz duckduckgo-search wikipedia scikit-learn
12
 
13
+ # Download TextBlob corpora (lite)
14
  RUN python -m textblob.download_corpora lite
15
 
16
+ # Pre-download some models to speed up runtime (best-effort)
17
  RUN python -c "from transformers import pipeline; pipeline('zero-shot-classification', model='typeform/distilbert-base-uncased-mnli')"
18
+ RUN python -c "from transformers import pipeline; pipeline('text-classification', model='j-hartmann/emotion-english-distilroberta-base')"
19
 
 
20
  COPY . .
21
 
22
  RUN chmod -R 755 .
23
 
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]