| FROM python:3.10 |
|
|
| |
| ENV TRANSFORMERS_CACHE=/tmp/transformers_cache |
| ENV HF_HOME=/tmp/huggingface_cache |
| RUN rm -rf ~/.cache/huggingface/transformers |
|
|
| |
| RUN apt-get update && apt-get install -y git wget git-lfs && git lfs install && apt-get clean |
|
|
| |
| RUN useradd -m -u 1000 user |
| RUN mkdir /ModerationModelCode && chown -R user:user /ModerationModelCode |
|
|
| USER user |
| ENV PATH="/home/user/.local/bin:$PATH" |
|
|
| RUN pwd |
| |
| USER root |
| RUN pwd |
| RUN ls |
| RUN GIT_LFS_SKIP_SMUDGE=0 git clone --depth 1 https://huggingface.co/InfosysEnterprise/ModerationModelCode /ModerationModelCode |
| RUN git config --global --add safe.directory /ModerationModelCode |
| RUN cd /ModerationModelCode && git log -1 --oneline && rm -rf .git |
| USER user |
|
|
| |
| RUN ls -lR /ModerationModelCode/models |
| RUN find /ModerationModelCode/models -type f -exec ls -lh {} + |
|
|
| |
| COPY --chown=user . /ModerationModelCode |
|
|
| WORKDIR /ModerationModelCode |
|
|
| RUN pip install --no-cache-dir \ |
| presidio-analyzer==2.2.355 |
| |
| |
| |
| |
|
|
| |
| RUN pip install --no-cache-dir https://huggingface.co/InfosysEnterprise/ModerationModelCode/resolve/main/lib/privacy-2.0.8-py3-none-any.whl |
| RUN pip install --no-cache-dir https://huggingface.co/InfosysEnterprise/ModerationModelCode/resolve/main/lib/en_core_web_lg-3.5.0-py3-none-any.whl |
|
|
| |
| RUN pip install --user --no-cache-dir -r /ModerationModelCode/requirements/requirement.txt |
|
|
| WORKDIR /ModerationModelCode/src |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["python", "main_MM.py"] |
|
|