Skip to main content

Facebook AI Research Sequence-to-Sequence Toolkit

Project description



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},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fairseq-0.12.2.tar.gz (9.6 MB view details)

Uploaded Source

Built Distributions

fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file fairseq-0.12.2.tar.gz.

File metadata

  • Download URL: fairseq-0.12.2.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for fairseq-0.12.2.tar.gz
Algorithm Hash digest
SHA256 34f1b18426bf3844714534162f065ab733e049597476daa35fffb4d06a92b524
MD5 1d22317681c3973c27e5bf41556b6d5f
BLAKE2b-256 3036db42846570f479ac859be3b48d8b47f2ae9b0b9c77487a512f2f2ecbcb6b

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 08fa308c760f995cdc13d9c385e2b9d923a78b48275d8b4d78f3a854c71a8f29
MD5 03bb14b55f6d38982b1ee46727603ba1
BLAKE2b-256 e18ccfca1b3c2e50983d0b51804ed24014573ff2aa42d8b4931760d57d6b2118

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b8c8b6dc368d2fd23a06ff613a2af05959eee275fe90846d7cffef4a43c522a
MD5 e5490d9726c9620f6a7a9bb90b134fa3
BLAKE2b-256 02a926614de9037c74115c75cd7dd8bd8fffeb289e08a12fd762e12c63a9f828

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 26454f334ca705c67f898846dff34e14c148fcdaf53b4f52d64209773b509347
MD5 94345614ad701c8fc1656a98d9d6c17e
BLAKE2b-256 9392469dbf90aaa4ada79266ea0a77f7c3ac8ad2332d8e59157d82c2455ea053

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c4877d65346797fc580a3a7e6e2364d2331a0026ef099c22eb8311441e49c2c6
MD5 0111c0fc9d2cdfadeeb6c18c756a9a54
BLAKE2b-256 7a27ddda16c37549e2c8d467669ae571d5ad78887f3bc92dc29903ac04b23086

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0543905012e39f00bd8c3f3781d9f49e76ab309801eb2eb7de250f5984df0de3
MD5 aec36794f1c8164cbd7286ba32d4a43b
BLAKE2b-256 322e68ea3ee7008ec07a2625ddd93f3be626f7cd1115a668a2deb7fbce693cc2

See more details on using hashes here.

File details

Details for the file fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fairseq-0.12.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fe65b07c5121b7cda0c7a17166994a6b0059259ce37881b6daa117b8c209b662
MD5 396b054b0cbda81def487a19b0ea64b0
BLAKE2b-256 2d0d90329be5d5ad207955fe9ba5b4924372c564d87ad929aa695f3fc3a68985

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page