Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
feat: CUDA 12.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jonafeucht committed Oct 24, 2024
1 parent 18a348c commit de7127a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.3-slim
FROM python:3.12.7-slim
WORKDIR /app
COPY . /app
RUN pip install --upgrade pip
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.cuda
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM nvidia/cuda:12.5.0-runtime-ubuntu22.04
FROM nvidia/cuda:12.6.2-runtime-ubuntu24.04
WORKDIR /app
COPY . /app
RUN apt-get update && \
apt-get install -y python3-pip && \
pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121
CMD ["fastapi", "run", "main.py", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"]
apt-get install -y python3-pip python3-venv && \
python3 -m venv /app/venv && \
/app/venv/bin/pip install --upgrade pip && \
/app/venv/bin/pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121
CMD ["/app/venv/bin/python", "-m", "fastapi", "run", "main.py", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"]
24 changes: 24 additions & 0 deletions docker-compose.dev.cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
cuda:
build:
context: .
dockerfile: ./Dockerfile.cuda
ports:
- "8000:8000"
volumes:
- ./models:/root/.cache/huggingface/hub:rw
environment:
- DEFAULT_MODEL_NAME
- BATCH_SIZE
- ACCESS_TOKEN
- DEFAULT_SCORE
- USE_API_KEYS
- API_KEYS
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
17 changes: 17 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
cpu:
build:
context: .
dockerfile: ./Dockerfile
ports:
- "8000:8000"
volumes:
- ./models:/root/.cache/huggingface/hub:rw
environment:
- DEFAULT_MODEL_NAME
- BATCH_SIZE
- ACCESS_TOKEN
- DEFAULT_SCORE
- USE_API_KEYS
- API_KEYS
restart: unless-stopped
11 changes: 4 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
image_video_classification:
cpu:
image: ghcr.io/doppeltilde/image_video_classification:latest
ports:
- "8000:8000"
volumes:
- models:/root/.cache/huggingface/hub:rw
- ./models:/root/.cache/huggingface/hub:rw
environment:
- DEFAULT_MODEL_NAME
- BATCH_SIZE
Expand All @@ -14,12 +14,12 @@ services:
- API_KEYS
restart: unless-stopped

image_video_classification_cuda:
cuda:
image: ghcr.io/doppeltilde/image_video_classification:latest-cuda
ports:
- "8000:8000"
volumes:
- models:/root/.cache/huggingface/hub:rw
- ./models:/root/.cache/huggingface/hub:rw
environment:
- DEFAULT_MODEL_NAME
- BATCH_SIZE
Expand All @@ -35,6 +35,3 @@ services:
- driver: nvidia
count: all
capabilities: [ gpu ]

volumes:
models:
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fastapi[standard]==0.112.0
Pillow==10.4.0
transformers==4.44.0
torch==2.4.0
fastapi[standard]==0.115.3
Pillow==11.0.0
transformers==4.46.0
torch==2.5.0
python-dotenv==1.0.1
filetype==1.2.0
opencv-python-headless==4.10.0.84
python-multipart==0.0.9
python-multipart==0.0.12

0 comments on commit de7127a

Please sign in to comment.