forked from h-uns/clef2024-human-value-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_predict
32 lines (23 loc) · 997 Bytes
/
Dockerfile_predict
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
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
ENV PYTHONPATH=/
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
SHELL ["/bin/bash", "-c"]
WORKDIR /
# Install requirements
COPY requirements_pip.txt /
RUN pip3 install -r /requirements_pip.txt
# pre-download tokenizer and models
RUN mkdir /models
RUN mkdir /tokenizer
COPY download_models_and_tokenizer.py /
RUN python3 download_models_and_tokenizer.py
# copy script files
COPY common_training /common_training/
COPY predict.py /predict.py
# switch to local tokenizers
RUN sed -i -e 's/microsoft\/deberta-v2-xxlarge/\/tokenizer\/microsoft\/deberta-v2-xxlarge/g' predict.py
RUN sed -i -e 's/FacebookAI\/xlm-roberta-large/\/tokenizer\/FacebookAI\/xlm-roberta-large/g' predict.py
RUN echo '#!/bin/bash' > /run.sh && \
echo 'python3 /predict.py --sentences-file /dataset/sentences.tsv --output-file /output/run.tsv --models-dir /models' >> /run.sh
ENTRYPOINT [ "sh", "/run.sh" ]