Setup the DNABERT-2 environment
mainTo use DNABERT-2, create a Python 3.8 virtual environment using Conda and install the required dependencies. If you want to use Flash Attention, you must also install triton from source.
Standard Installation
- Create and activate a Conda environment named
dnawith Python 3.8. - Install dependencies from
requirements.txt.
Optional: Install Triton for Flash Attention
If you require Flash Attention, follow these steps to build triton from source:
- Clone the OpenAI Triton repository.
- Navigate to the
triton/pythondirectory. - Install
cmakeas a build dependency. - Install Triton in editable mode.
# create and activate virtual python environment
conda create -n dna python=3.8
conda activate dna
# (optional if you would like to use flash attention)
# install triton from source
git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build-time dependency
pip install -e .
# install required packages
python3 -m pip install -r requirements.txt