-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·52 lines (40 loc) · 2.03 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM nvidia/cuda:11.2.0-cudnn8-runtime-ubuntu20.04
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \
# Install python, gcc (for pycocotools) and other tools
python3 python3-pip python3-venv gcc build-essential wget unzip \
# Install audio dependencies
ffmpeg libsndfile-dev \
# Install Java
software-properties-common openjdk-8-jdk-headless && export JAVA_HOME \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Configure Poetry
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Install Poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==1.2.2
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# Install Python dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install
# Download spacy 'en' model
RUN poetry run python3 -m spacy download en_core_web_sm
# Download and extract the playntell datasets and the trained model
RUN mkdir -p /data/playlist-captioning/p/curated-deezer/algorithm-data/
RUN wget -nc https://zenodo.org/record/7427231/files/playntell_data_and_model.tar
RUN tar -xf playntell_data_and_model.tar -C .
# Extract the curated-deezer and curated-spotify datasets, and a test playlist containing noise
RUN cp -r playntell_data_and_model/playntell_datasets/* /data/playlist-captioning/p/
# Extract the already trained model and copy the discog tag embeddings
RUN cp -r playntell_data_and_model/playntell /data/playlist-captioning/p/curated-deezer/algorithm-data/
COPY data/discogs_tags_embeddings.npy /data/playlist-captioning/p/
RUN rm -r playntell_data_and_model.tar playntell_data_and_model/
COPY playntell/ playntell/
# Download the GPT2 model
RUN wget -nc -P ./playntell/audio_gpt/ https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin
CMD poetry run python3 playntell/training_experiments/train_playntell.py