Skip to content

ktym/BioGPT-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioGPT-docker

Dockerfile for the BioGPT.

Build

% git clone https://github.com/ktym/BioGPT-docker.git
% cd BioGPT-docker/docker
% docker image build -t biogpt:1.0 .
% cd ..

Data

Download and extract pre-trained models from BioGPT.

% cd models
% sh download.sh
% cd ..

GPUs

Confirm your server is equipped with GPUs.

% nvidia-smi

Install NVIDIA Container Toolkit on the host OS.

% distribution=$(source /etc/os-release; echo $ID$VERSION_ID)
% curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
% curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
% sudo apt update && sudo apt install -y nvidia-container-toolkit
% sudo systemctl restart docker

Confirm your installation is successful.

% nvidia-container-cli info

Run the docker container with a GPU option and confirm the host GPUs are available from the guest OS.

% docker run --gpus --rm biogpt:1.0 nvidia-smi

Note: make sure the NVIDIA driver versions of the host and guest OSs should be matched.

Test

Mount and link the directory containing downloaded models as ${APP_DIR}/BioGPT/checkpoints. Suppose if you have stored pre-trained models under the ./models directory on the host OS, then log in to the guest OS and create a symbolic link from the mounted directory.

Example codes listed in the BioGPT repository are stored in the test directory for ease.

% docker run --gpus --rm -it -v $(pwd):/mnt biogpt:1.0 /bin/bash
root:/app/BioGPT# ln -sf /mnt/models checkpoints
root:/app/BioGPT# python3.10 /mnt/test/test1.py
root:/app/BioGPT# python3.10 /mnt/test/test2.py

CPUs

If your server is not equipped with NVIDIA GPUs (CUDA), you can still use BioGPT only with CPUs.

First, build the docker image with the Dockerfile.noGPU file.

% cd BioGPT-docker/docker
% docker image build -t biogpt-nogpu:1.0 -f Dockerfile.noGPU .
% cd ..

Then test it without --gpu option.

% docker run --rm -it -v $(pwd):/mnt biogpt-nogpu:1.0 /bin/bash
root:/app/BioGPT# ln -sf /mnt/models checkpoints
root:/app/BioGPT# python /mnt/test/test1-nogpu.py

License

The dockerfile and scripts provided in this repository are MIT-licensed.

Author

Toshiaki Katayama (Database Center for Life Science, Japan)

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published