Registry / ai-ml / fairseq

fairseq

JSON →
library0.12.2pypypiunverified

fairseq is a sequence-to-sequence toolkit by Facebook AI Research, written in PyTorch. It provides reference implementations of various models for machine translation, language modeling, and other sequence generation tasks. Current version: 0.12.2. Release cadence is irregular, with the last significant release in 2021.

pip install fairseq
INSTALL
IMPORT
SIG · FAIRSEQ
F
fairseq
ai-mlpythonv0.12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fairseq
import fairseq
import fairseq

Quickstart: load a pretrained translation model and translate a sentence.

import torch import fairseq # Load a pretrained model from torch.hub model = torch.hub.load('pytorch/fairseq', 'transformer.wmt14.en-fr', tokenizer='moses', bpe='subword_nmt') # Prepare input input_text = 'Hello world!' # Translate print(model.translate(input_text))
fairseq --version
Debug
Known issues
breakingBetween v0.9.0 and v0.10.0, the MultiheadAttention module changed from a single 'in_proj_weight' to separate k, v, q projections. Models saved with older versions will not load directly.
fix
Update model checkpoints or adjust code to match new parameter structure.
affects: 0.9.0 and earlier vs 0.10.0+
breakingIn v0.8.0, the torch.hub interface changed: 'generate' was renamed to 'translate'. Code using 'generate' will break.
fix
Replace .generate() with .translate() in your code.
affects: 0.7.x vs 0.8.0+
deprecatedMany components (e.g., older masked LM modules, dataset formats) have been deprecated or replaced. The project is in maintenance mode with few updates.
fix
Refer to the latest documentation and avoid using deprecated APIs.
affects: all
gotchafairseq is no longer actively maintained; new projects should consider alternatives like fairseq2 or direct PyTorch implementations.
fix
For new projects, consider using fairseq2 or other actively maintained toolkits.
affects: all
gotchaInstalling from source may require specific PyTorch versions (e.g., PyTorch 1.8 or older). Check the setup.py for exact dependencies.
fix
Use pip install fairseq to get prebuilt wheels or carefully match PyTorch version when building from source.
affects: all
Upgrade
Version history
0.12.2latest on PyPI · released Jun 27, 2022
Audit
Dependencies
torchrequiredRequired for tensor operations and neural network modules
numpyrequiredUsed for numerical operations
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
fairseq — pip install fairseq · libregistry