Skip to main content



Support Ukraine MIT License Latest Release Build Status Documentation Status CicleCI Status


Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling and other text generation tasks.

We provide reference implementations of various sequence modeling papers:

List of implemented papers

What's New:

Previous updates

Features:

We also provide pre-trained models for translation and language modeling with a convenient torch.hub interface:

en2de = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.en-de.single_model')
en2de.translate('Hello world', beam=5)
# 'Hallo Welt'

See the PyTorch Hub tutorials for translation and RoBERTa for more examples.

Requirements and Installation

  • PyTorch version >= 1.5.0
  • Python version >= 3.6
  • For training new models, you'll also need an NVIDIA GPU and NCCL
  • To install fairseq and develop locally:
git clone https://github.com/pytorch/fairseq
cd fairseq
pip install --editable ./

# on MacOS:
# CFLAGS="-stdlib=libc++" pip install --editable ./

# to install the latest stable release (0.10.x)
# pip install fairseq
  • For faster training install NVIDIA's apex library:
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" \
  --global-option="--deprecated_fused_adam" --global-option="--xentropy" \
  --global-option="--fast_multihead_attn" ./
  • For large datasets install PyArrow: pip install pyarrow
  • If you use Docker make sure to increase the shared memory size either with --ipc=host or --shm-size as command line options to nvidia-docker run .

Getting Started

The full documentation contains instructions for getting started, training new models and extending fairseq with new model types and tasks.

Pre-trained models and examples

We provide pre-trained models and pre-processed, binarized test sets for several tasks listed below, as well as example training and evaluation commands.

We also have more detailed READMEs to reproduce results from specific papers:

Join the fairseq community

License

fairseq(-py) is MIT-licensed. The license applies to the pre-trained models as well.

Citation

Please cite as:

@inproceedings{ott2019fairseq,
  title = {fairseq: A Fast, Extensible Toolkit for Sequence Modeling},
  author = {Myle Ott and Sergey Edunov and Alexei Baevski and Angela Fan and Sam Gross and Nathan Ng and David Grangier and Michael Auli},
  booktitle = {Proceedings of NAACL-HLT 2019: Demonstrations},
  year = {2019},
}

Metadata

Release files for fairseq 0.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fairseq 0.12.2
File Size Uploaded
fairseq-0.12.2.tar.gz 9.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for fairseq 0.12.2
File
fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 73.5 MB

Release files / fairseq-0.12.2.tar.gz

Download URL fairseq-0.12.2.tar.gz
Size 9.6 MB
Tags Source
SHA-256 checksum
How to use checksums
34f1b18426bf3844714534162f065ab733e049597476daa35fffb4d06a92b524
BLAKE2b-256 checksum
How to use checksums
3036db42846570f479ac859be3b48d8b47f2ae9b0b9c77487a512f2f2ecbcb6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 11.0 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
08fa308c760f995cdc13d9c385e2b9d923a78b48275d8b4d78f3a854c71a8f29
BLAKE2b-256 checksum
How to use checksums
e18ccfca1b3c2e50983d0b51804ed24014573ff2aa42d8b4931760d57d6b2118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl

Download URL fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3b8c8b6dc368d2fd23a06ff613a2af05959eee275fe90846d7cffef4a43c522a
BLAKE2b-256 checksum
How to use checksums
02a926614de9037c74115c75cd7dd8bd8fffeb289e08a12fd762e12c63a9f828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 11.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
26454f334ca705c67f898846dff34e14c148fcdaf53b4f52d64209773b509347
BLAKE2b-256 checksum
How to use checksums
9392469dbf90aaa4ada79266ea0a77f7c3ac8ad2332d8e59157d82c2455ea053
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c4877d65346797fc580a3a7e6e2364d2331a0026ef099c22eb8311441e49c2c6
BLAKE2b-256 checksum
How to use checksums
7a27ddda16c37549e2c8d467669ae571d5ad78887f3bc92dc29903ac04b23086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 11.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0543905012e39f00bd8c3f3781d9f49e76ab309801eb2eb7de250f5984df0de3
BLAKE2b-256 checksum
How to use checksums
322e68ea3ee7008ec07a2625ddd93f3be626f7cd1115a668a2deb7fbce693cc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
fe65b07c5121b7cda0c7a17166994a6b0059259ce37881b6daa117b8c209b662
BLAKE2b-256 checksum
How to use checksums
2d0d90329be5d5ad207955fe9ba5b4924372c564d87ad929aa695f3fc3a68985
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.12.2 This release

7 release files

0.12.1

7 release files

0.12.0

7 release files

0.11.1

4 release files

0.10.1

7 release files

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.6.2

1 release file

0.6.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page