AdityaAjithKumar commited on
Commit
47bedb5
·
1 Parent(s): 5ddbd3b

Added Dependencies

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. requirements.txt +3 -2
Dockerfile CHANGED
@@ -2,10 +2,10 @@ FROM python:3.12-slim
2
  WORKDIR /app
3
  COPY . .
4
 
5
- # First install normal packages from PyPI
6
- RUN pip install --no-cache-dir fastapi uvicorn transformers pillow
7
 
8
- # Then install PyTorch CPU version from its own index
9
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
10
 
11
  EXPOSE 7860
 
2
  WORKDIR /app
3
  COPY . .
4
 
5
+ # Normal packages + accelerate (fixes the device_map error)
6
+ RUN pip install --no-cache-dir fastapi uvicorn transformers pillow accelerate
7
 
8
+ # PyTorch CPU version (required for the model)
9
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
10
 
11
  EXPOSE 7860
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  fastapi
2
  uvicorn
3
- torch --index-url https://download.pytorch.org/whl/cpu
4
  transformers
5
- pillow
 
 
 
1
  fastapi
2
  uvicorn
 
3
  transformers
4
+ pillow
5
+ accelerate
6
+ torch --index-url https://download.pytorch.org/whl/cpu