saadkhi commited on
Commit
28609da
·
verified ·
1 Parent(s): 17bc164

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.10
2
 
3
  WORKDIR /app
4
 
@@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Pre-download model (IMPORTANT: avoids runtime network issues)
16
  RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \
17
  AutoTokenizer.from_pretrained('distilgpt2'); \
18
  AutoModelForCausalLM.from_pretrained('distilgpt2')"
@@ -22,4 +22,4 @@ COPY app.py .
22
 
23
  EXPOSE 7860
24
 
25
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Pre-download model (IMPORTANT)
16
  RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \
17
  AutoTokenizer.from_pretrained('distilgpt2'); \
18
  AutoModelForCausalLM.from_pretrained('distilgpt2')"
 
22
 
23
  EXPOSE 7860
24
 
25
+ CMD ["python", "app.py"]