ai2-tango requires Python 3.8 or later.
ai2-tango is available on PyPI. Just run
pip install ai2-tango
To install with a specific integration, such as
torch for example, run
pip install 'ai2-tango[torch]'
To install with all integrations, run
pip install 'ai2-tango[all]'
ai2-tango is available on conda-forge. You can install just the base package with
conda install tango -c conda-forge
You can pick and choose from the integrations with one of these:
conda install tango-datasets -c conda-forge conda install tango-pytorch_lightning -c conda-forge conda install tango-torch -c conda-forge conda install tango-wandb -c conda-forge
You can also install everything:
conda install tango-all -c conda-forge
Even though ai2-tango itself is quite small, installing everything will pull in a lot of dependencies. Don’t be surprised if this takes a while!
Installing from source#
To install ai2-tango from source, first clone the repository:
git clone https://github.com/allenai/tango.git cd tango
pip install -e '.[all]'
To install with only a specific integration, such as
torch for example, run
pip install -e '.[torch]'
Or to install just the base tango library, you can run
pip install -e .
Checking your installation#
to check your installation.
You can build a Docker image suitable for tango projects by using the official Dockerfile as a starting point for your own Dockerfile, or you can simply use one of our prebuilt images as a base image in your Dockerfile. For example:
# Start from a prebuilt tango base image. # You can choose the right tag from the available options here: # https://github.com/allenai/tango/pkgs/container/tango/versions FROM ghcr.io/allenai/tango:cuda11.3 # Install your project's additional requirements. COPY requirements.txt . RUN /opt/conda/bin/pip install --no-cache-dir -r requirements.txt # Install source code. # This instruction copies EVERYTHING in the current directory (build context), # which may not be what you want. Consider using a ".dockerignore" file to # exclude files and directories that you don't want on the image. COPY . .
Make sure to choose the right base image for your use case depending on the version of tango you’re using and the CUDA version that your host machine supports. You can see a list of all available image tags on GitHub.