FROM huggingface/transformers-pytorch-gpu
# Install Infiniband drivers
RUN apt-get install -y libibverbs-dev librdmacm-dev libibumad-dev ibutils
#####################
# GH CLI & STARSHIP #
#####################
# Prep apt for GitHub CLI
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y curl apt-utils
# GitHub CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install gh -y
RUN apt-get upgrade -y
# Starship Prompt
RUN curl -sS https://starship.rs/install.sh -o starship-install.sh
RUN sh starship-install.sh --yes
RUN echo 'eval "$(starship init bash)"' >> ~/.bashrc
# Starship Config
COPY starship.toml /root/.config/starship.toml
#####################
# PYTHON PACKAGES #
#####################
# Disable the "running pip as the 'root' user can..." warning
ENV PIP_ROOT_USER_ACTION=ignore
# Upgrade pip
RUN pip3 install --upgrade pip
# Upgrade important packages
RUN pip3 install --upgrade torch torchvision torchaudio
RUN pip3 install --upgrade transformers accelerate xformers deepspeed
# Other useful machine learning packages
RUN pip3 install --upgrade fire tqdm openai numpy rouge_score wandb ipython emoji tokenizers evaluate matplotlib seaborn lm-eval jupyter nltk tiktoken aiolimiter swifter pytorch-lightning lightning sentencepiece jsonargparse[signatures] bitsandbytes datasets zstandard rich
#####################
# ALIASES #
#####################
# show-gpus, watch-gpus
COPY show_gpus.py /root/show_gpus.py
RUN echo 'alias show-gpus="python3 /root/show_gpus.py"' >> ~/.bashrc
RUN echo 'alias watch-gpus="watch -c python3 /root/show_gpus.py"' >> ~/.bashrc