Installation

This guide covers installing MAMMOTH on a local machine or a generic GPU server. For the CSC supercomputers (LUMI and Roihu), which need cluster-specific modules or a container, see the LUMI & Roihu quickstart.

Requirements

  • Python 3.10 or newer

  • PyTorch 2.8 or newer (the test suite is verified on 2.8.0). A GPU build is needed for real training. CPU-only is fine for tests and small experiments.

  • A Unix-like OS (Linux or macOS)

Install from PyPI

pip install mammoth-nlp

This installs the package and its console scripts, but not the dependencies (see the note above). Install PyTorch and the packages from requirements.txt separately.

Verify the installation

python -c "import mammoth, torch; print('torch', torch.__version__, '| cuda', torch.cuda.is_available())"
mammoth_train --help

The command-line tools installed by pip install -e . are:

Command Purpose
mammoth_train train a model (equivalent to python train.py)
mammoth_translate translate with a trained model
mammoth_config_config generate multi-task configs, see config_config
mammoth_iterate_tasks list the tasks in a config, optionally as --task_id arguments with --src/--output path templates (handy for translation scripts)
mammoth_generate_synth_data generate synthetic toy data for the quickstart

The repository root also has train.py and translate.py, which do the same thing without installing the package.

Optional dependencies

  • Hugging Face tokenizers and export. requirements.txt already includes tokenizers, transformers, huggingface-hub and safetensors. See the HF tokenizers guide and the export guide.

Next steps