khushalcodiste commited on
Commit
f1cddcd
·
1 Parent(s): 4774793

fix: added

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -7
  2. requirements.txt +2 -2
Dockerfile CHANGED
@@ -1,8 +1,7 @@
1
- FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime
2
 
3
  WORKDIR /app
4
 
5
- # libgl1 + libglib2.0-0 are required by Pillow/OpenCV in minimal container environments
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  git \
@@ -10,15 +9,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
10
  libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements and install Python deps
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy application code
18
  COPY app.py .
19
 
20
- # HF Spaces expects port 7860
21
  EXPOSE 7860
22
 
23
- # Run the FastAPI app
24
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential \
7
  git \
 
9
  libglib2.0-0 \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
 
15
  COPY app.py .
16
 
 
17
  EXPOSE 7860
18
 
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  fastapi==0.115.6
2
  uvicorn[standard]==0.34.0
3
- transformers @ git+https://github.com/huggingface/transformers.git@main
4
- optimum[onnxruntime]
5
  Pillow==11.1.0
6
  python-multipart==0.0.20
 
1
  fastapi==0.115.6
2
  uvicorn[standard]==0.34.0
3
+ transformers>=4.51.0
4
+ optimum[onnxruntime]>=1.24.0
5
  Pillow==11.1.0
6
  python-multipart==0.0.20