defford commited on
Commit
e95db50
·
verified ·
1 Parent(s): 0175efa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a modern PyTorch image that already has CUDA 12+
2
+ FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel
3
+
4
+ # Install the exact versions we need
5
+ RUN pip install --no-cache-dir \
6
+ transformers>=5.1.0 \
7
+ accelerate \
8
+ fastapi \
9
+ uvicorn \
10
+ python-multipart \
11
+ pillow
12
+
13
+ # Copy your model files into the container
14
+ COPY . /repository
15
+ WORKDIR /repository
16
+
17
+ # Expose the port Hugging Face expects
18
+ EXPOSE 80
19
+
20
+ # Start a tiny web server that talks to your handler.py
21
+ # We use a helper script to bridge the gap
22
+ CMD ["uvicorn", "handler:app", "--host", "0.0.0.0", "--port", "80"]