|
FROM python:3.9-slim |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache |
|
ENV HF_HOME=/tmp/huggingface_cache |
|
|
|
|
|
RUN apt-get update && apt-get install -y git wget |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
RUN mkdir /Responsible-Ai-Moderation-Models && chown -R user:user /Responsible-Ai-Moderation-Models |
|
|
|
USER user |
|
|
|
|
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
|
|
RUN pip install --user huggingface_hub transformers git+https://github.com/huggingface/transformers.git |
|
|
|
RUN pwd |
|
|
|
|
|
RUN git clone https://huggingface.co/InfosysResponsibleAiToolKit/Responsible-Ai-Moderation-Models /Responsible-Ai-Moderation-Models |
|
|
|
RUN git clone https://huggingface.co/spaces/InfosysResponsibleAiToolKit/torch /Responsible-Ai-Moderation-Models/torch |
|
|
|
RUN mv /Responsible-Ai-Moderation-Models/torch/torch-2.2.0+cu118-cp39-cp39-linux_x86_64.whl /Responsible-Ai-Moderation-Models/ |
|
|
|
COPY --chown=user . . |
|
|
|
RUN ls -la |
|
|
|
COPY --chown=user . /Responsible-Ai-Moderation-Models |
|
|
|
WORKDIR /Responsible-Ai-Moderation-Models |
|
|
|
RUN ls -la |
|
|
|
RUN pip install --no-cache-dir /Responsible-Ai-Moderation-Models/privacy-2.0.8-py3-none-any.whl |
|
|
|
RUN pip install --no-cache-dir /Responsible-Ai-Moderation-Models/en_core_web_lg-3.5.0-py3-none-any.whl |
|
|
|
RUN pip install torch==2.2.0 |
|
|
|
RUN pip install transformers==4.41.0 |
|
|
|
RUN pip install diffusers==0.27.2 |
|
|
|
RUN echo "git install====" > /dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --user --no-cache-dir -r requirements/requirement.txt |
|
|
|
RUN pip list |
|
|
|
WORKDIR /Responsible-Ai-Moderation-Models/src |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
CMD ["python", "main.py"] |
|
|
|
|