File size: 1,227 Bytes
edc5644
 
 
 
 
 
25dccb2
edc5644
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bff0de2
 
 
 
 
 
edc5644
 
 
f2d1f42
a308062
 
 
edc5644
 
 
a308062
edc5644
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use the official Python 3.10 image
FROM python:3.10

# Set the working directory in the container
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    ffmpeg \
    libsm6 \
    libxext6 \
    cmake \
    rsync \
    libgl1-mesa-glx

# Copy requirements.txt to the working directory
COPY requirements.txt .

# Upgrade pip to avoid any compatibility issues
RUN pip install --upgrade pip
RUN pip install --upgrade transformers  # Upgrade transformers here
# Check transformers version
RUN python -c "import transformers; print(transformers.__version__)"
RUN python test_import.py
RUN pip show transformers
RUN python -c "from transformers import SegformerForImageSegmentation"

# Install the required Python packages
RUN pip install -r requirements.txt
RUN pip install --upgrade transformers  # Upgrade transformers here
# Check transformers version
RUN python -c "import transformers; print(transformers.__version__)"
RUN python test_import.py

# Copy the rest of the application code to the working directory
COPY . .
COPY test_import.py 
# Command to run the app with Streamlit
CMD ["streamlit", "run", "app.py", "--server.port=8080", "--server.address=0.0.0.0"]