Asad235 commited on
Commit
dfe2ac6
·
verified ·
1 Parent(s): 18ad2c3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -9
Dockerfile CHANGED
@@ -1,21 +1,33 @@
1
  FROM python:3.10-slim
2
 
3
- # system dependencies
4
  RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
5
 
6
- # working directory
7
  WORKDIR /app
8
 
9
- # copy files
10
  COPY . /app
11
 
12
- # install python packages
13
  RUN pip install --no-cache-dir --upgrade pip
14
- RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
15
- RUN pip install --no-cache-dir transformers gradio accelerate sentencepiece
16
 
17
- # expose port
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  EXPOSE 7860
19
 
20
- # run app
21
- CMD ["python", "app2.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # system deps
4
  RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
5
 
 
6
  WORKDIR /app
7
 
 
8
  COPY . /app
9
 
10
+ # pip upgrade
11
  RUN pip install --no-cache-dir --upgrade pip
 
 
12
 
13
+ # 🔥 FIXED: compatible transformers version
14
+ RUN pip install --no-cache-dir \
15
+ torch==2.1.2+cpu \
16
+ torchvision \
17
+ torchaudio \
18
+ --index-url https://download.pytorch.org/whl/cpu
19
+
20
+ RUN pip install --no-cache-dir \
21
+ transformers==4.38.2 \
22
+ gradio \
23
+ accelerate \
24
+ sentencepiece \
25
+ huggingface_hub
26
+
27
+ # optional (HF token support)
28
+ ENV HF_HOME=/app/cache
29
+ ENV TRANSFORMERS_CACHE=/app/cache
30
+
31
  EXPOSE 7860
32
 
33
+ CMD ["python", "app.py"]