File size: 1,957 Bytes
dcd9283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f2fcfef
cae9aae
dcd9283
 
 
 
 
 
 
 
 
6a07999
 
 
 
 
 
dcd9283
 
 
 
 
 
 
 
 
 
 
 
c769fe7
 
 
dcd9283
3e22689
 
 
 
bad7348
 
dcd9283
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM python:3.11

RUN apt-get update \
&& apt-get -y install tesseract-ocr
RUN : \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install ffmpeg libsm6 libxext6  -y

# Install dependencies
RUN apt-get update && apt-get install -y git wget

# Create and use a non-root user
RUN useradd -m -u 1000 user

# Create the directory for the repository and give the non-root user access to it
RUN mkdir /Responsible-AI-Privacy && chown -R user:user /Responsible-AI-Privacy

USER user

# Update PATH to include the user's local bin directory
ENV PATH="/home/user/.local/bin:$PATH"


# Install Hugging Face dependencies and other packages
RUN pip install --user huggingface_hub transformers git+https://github.com/huggingface/transformers.git

RUN echo "added model" > /dev/null

# Clone the repository
RUN git clone https://huggingface.co/InfosysResponsibleAiToolKit/Responsible-AI-Privacy /Responsible-AI-Privacy

COPY --chown=user . .

RUN ls -la

COPY --chown=user . /Responsible-AI-Privacy/responsible-ai-privacy/lib


# Check if the file exists in the expected location
RUN if [ ! -f "/Responsible-AI-Privacy/responsible-ai-privacy/src/privacy/util/model/craft_mlt_25k.pth" ]; then \
    echo "File does not exist!"; exit 1; \
    else echo "File exists!"; fi

WORKDIR /Responsible-AI-Privacy/responsible-ai-privacy

RUN ls -la

RUN pip install --no-cache-dir /Responsible-AI-Privacy/responsible-ai-privacy/lib/en_core_web_lg-3.7.1-py3-none-any.whl

RUN pip install -r requirements/requirement.txt

RUN pip install datasets==2.15.0

RUN pip install numpy==1.26.2

RUN pip install torch==2.4.1 

RUN pip install torchvision==0.15.1

RUN pip show torch

RUN pip show torchvision

WORKDIR /Responsible-AI-Privacy/responsible-ai-privacy/src

EXPOSE 30002

CMD ["sh","-c","python3 privacy_main.py"]