Rockk08 commited on
Commit
a209fd7
·
1 Parent(s): 4b6ecd4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -6
Dockerfile CHANGED
@@ -1,17 +1,23 @@
1
- # Use Hugging Face's transformers image as the base image
2
- FROM transformers:4.11.3-gpu
3
 
4
- # Set the working directory in the container
5
  WORKDIR /code
6
 
7
  # Copy the requirements file
8
  COPY ./requirements.txt /code/requirements.txt
9
 
10
- # Install additional dependencies
 
 
 
 
 
 
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
- # Copy the application files to the container
14
  COPY . .
15
 
16
- # Specify the command to run on container start
17
  CMD ["python", "caption_api.py", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use NVIDIA CUDA base image
2
+ FROM nvidia/cuda:11.4.1-cudnn8-devel-ubuntu20.04
3
 
4
+ # Set the working directory
5
  WORKDIR /code
6
 
7
  # Copy the requirements file
8
  COPY ./requirements.txt /code/requirements.txt
9
 
10
+ # Install required dependencies, including CUDA toolkit
11
+ RUN apt-get update && \
12
+ apt-get install -y --no-install-recommends \
13
+ cuda-toolkit-11-4 && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ # Install Python dependencies
17
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
18
 
19
+ # Copy the rest of the application code
20
  COPY . .
21
 
22
+ # Specify the default command to run on container start
23
  CMD ["python", "caption_api.py", "--host", "0.0.0.0", "--port", "7860"]