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.1.tar.gz (9.6 MB view details)

Uploaded Source

Built Distributions

fairseq-0.12.1-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.1-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.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.9 MB view details)

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

fairseq-0.12.1-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.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.9 MB view details)

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

fairseq-0.12.1-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.1.tar.gz.

File metadata

  • Download URL: fairseq-0.12.1.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.1.tar.gz
Algorithm Hash digest
SHA256 69eb0fa48e6ac2e53a8f3c146c9fd9582d748cd1f5c920a0fb305ba69f8e0b4a
MD5 b20dfbe1edec473aac4523c8eba8d825
BLAKE2b-256 d70fb7043b451a97eb9b4cfb1b1e23e567b947d9d7bca542403228bd53b435fe

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 29ba6e0f398a382ebb5a62f57fb31eb72da434a0201dd6b314d41963ae674e79
MD5 99aa7a12134d0a463c321a34db81e0d0
BLAKE2b-256 baaa0ec12b2f61939f04b3bf20760f39104feb34217483cb6bbcae218f954a78

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4e95e7cf7b0d2a0ae4b9da5e1ef2926b8468a7c7ca5b4bd41beb48e871371c51
MD5 7f80bfdc5e0eaf7b5078752078376b96
BLAKE2b-256 bcd0f9b2197c3615367e4bc4a58bc848a7d7a90cf8aa6d977d51b1e1163b3432

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b7be3dded2b9fc1cac89dac1bab9e4f47162b9aefb18e55311593122fb66809b
MD5 6f68bec57b72ef3f2935aec1fea957e4
BLAKE2b-256 088e8db244db43dfecaca7f72026d8ea4eb652cfd6cfadff2905bb83f5091037

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6b0e666b6363871f8260acf58c764d25bd39a5f9013caceb7d36ea3853ba77ed
MD5 e53d7baa733ebe28f9bf74184bba218b
BLAKE2b-256 b99ecc6cbe10cd806edd7af0e002ab4c6254ea04c12e7186137d2167172766ae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b3f47a3475182dc5dbe6c1861c2947bf3ba5b13d5a40b7cde1559590b4da5c1d
MD5 b2b023e56361aa6ce8d38a6dc766b742
BLAKE2b-256 c2dde2931e9ed1ea3de51c16187cea9140b2c0253696160a262c67fbec64c6e0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fairseq-0.12.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 231a436cc9edc0d952c2da848adfd506b11c198c8f4c515459ac6cdf08b871ac
MD5 828b1d06376bcef266bdfbdc2a20a987
BLAKE2b-256 1f4772945982956d1718ce04aab9513d8999913404b518cc70d6539dd5396127

See more details on using hashes here.

Provenance

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