Documentation (Nightly) | Install From: PyPI, Source
❗fairseq2 is still under heavy development (early beta quality). Please use with caution and do not hesitate to share feedback with us!
fairseq2 is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling, and other content generation tasks. It is also the successor of fairseq.
You can find our full documentation including tutorials and API reference here (nightly).
For recent changes, you can check out our changelog.
Note that fairseq2 mainly supports Linux. There is partial support for macOS with limited feature set (i.e. no CUDA). Windows support is not planned.
As of today, the following projects use fairseq2:
- SeamlessM4T: A state-of-the-art, all-in-one, multimodel translation model
- SONAR: A multilingual and multimodal fixed-size sentence embedding space, with a full suite of speech and text encoders and decoders
In the following 0.x releases, we will gradually add examples and recipes for training, fine-tuning, and evaluation of different model architectures.
As of today, we only provide pre-built wheels for Linux x86-64. For installation on macOS, please follow the instructions at "Install from Source".
The easiest way to start with fairseq2 is to install it via pip. Before you proceed, make sure that you have an up-to-date version of pip.
pip install --upgrade pip
And, use the following command:
pip install fairseq2
This will install a version of fairseq2 that is compatible with the latest PyTorch version hosted on PyPI.
fairseq2 consists of two packages; the user-facing fairseq2 package implemented in pure Python, and fairseq2n that contains the C++ and CUDA pieces of the library. If you are interested in Python parts only, you can use the following instructions. For C++/CUDA development, please follow the instructions here.
First, clone the fairseq2 repository to your machine:
git clone https://github.com/facebookresearch/fairseq2.git
cd fairseq2
And, install the fairseq2 package from the repo directory:
pip install .
If you are interested in editing Python code and/or contributing to fairseq2, you can instead use the editable mode:
pip install -r requirements-devel.txt
pip install -e .
We always welcome contributions to fairseq2! Please refer to our contribution guidelines to learn how to format, test, and submit your work.
This project is MIT licensed, as found in the LICENSE file.
Copyright © Meta Platforms, Inc