-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 1003 Bytes
/
Dockerfile
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
FROM pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime
RUN groupadd -r user && useradd -m --no-log-init -r -g user user
RUN mkdir -p /opt/app /input /output \
&& chown user:user /opt/app /input /output
USER user
WORKDIR /opt/app
ENV PATH="/home/user/.local/bin:${PATH}"
RUN python -m pip install --user -U pip && python -m pip install --user pip-tools
# Install the requirements
COPY --chown=user:user requirements.txt .
RUN python -m pip install --user -r requirements.txt \
&& rm -rf /home/user/.cache/pip
# Download the model, tokenizer and metrics
COPY --chown=user:user download_model.py /opt/app/
RUN python download_model.py --model_name joeranbosma/dragon-bert-base-domain-specific
COPY --chown=user:user download_metrics.py /opt/app/
RUN python download_metrics.py
# Set the environment variables
ENV TRANSFORMERS_OFFLINE=1
ENV HF_EVALUATE_OFFLINE=1
ENV HF_DATASETS_OFFLINE=1
# Copy the algorithm code
COPY --chown=user:user process.py .
ENTRYPOINT [ "python", "-m", "process" ]