repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/models/s2t_dualinputtransformer.py | examples/speech_text_joint_to_text/models/s2t_dualinputtransformer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from collections import namedtuple
import torch
import torch.nn as nn
from fairseq import checkpoint_utils
from fairseq import... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/criterions/multi_modality_compound.py | examples/speech_text_joint_to_text/criterions/multi_modality_compound.py | #
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import math
from dataclasses import dataclass, field
from fairseq import utils
from fairseq.logging import metrics
from fairseq.criterions import FairseqCriterion, register_crite... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/criterions/text_guide_cross_entropy_acc.py | examples/speech_text_joint_to_text/criterions/text_guide_cross_entropy_acc.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.criterions import FairseqCriterion, register_c... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/criterions/multi_modality_cross_entropy.py | examples/speech_text_joint_to_text/criterions/multi_modality_cross_entropy.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import utils
from fairseq.criterions import register_criterion
from fairseq.criterions.label_smoothed_cross_entropy ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/criterions/__init__.py | examples/speech_text_joint_to_text/criterions/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import importlib
import os
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith(".py") and not file.startswith("_"):
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_text_joint_to_text/data/pair_denoising_dataset.py | examples/speech_text_joint_to_text/data/pair_denoising_dataset.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import math
import re
import torch
from fairseq.data import data_utils
from fairseq.data.language_pair_dataset import LanguagePa... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/generate_waveform_from_code.py | examples/speech_to_speech/generate_waveform_from_code.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import logging
from pathlib import Path
import random
import soundfile as sf
import torch
from tqdm import tqdm
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/__init__.py | examples/speech_to_speech/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import unity # noqa
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/benchmarking/data_utils.py | examples/speech_to_speech/benchmarking/data_utils.py | from fairseq import tasks
import numpy as np
import logging
import random
from fairseq import options
import torch
import os
import soundfile as sf
from fairseq.data.audio.audio_utils import (
get_waveform,
parse_path,
)
logging.basicConfig()
logging.root.setLevel(logging.INFO)
logging.basicConfig(level=loggi... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/benchmarking/get_metrics.py | examples/speech_to_speech/benchmarking/get_metrics.py | import copy
import torch
import logging
from argparse import Namespace
import yaml
from fairseq import options
from examples.speech_to_speech.benchmarking.core import (
Processing,
SpeechGeneration,
Cascaded2StageS2ST,
Cascaded3StageS2ST,
S2UT,
)
from examples.speech_to_speech.benchmarking.data_util... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/benchmarking/core.py | examples/speech_to_speech/benchmarking/core.py | import timeit
import logging
import torch
from pypapi import events, papi_high as high
from memory_profiler import memory_usage
from torch import nn
from argparse import Namespace
from fairseq.dataclass.utils import convert_namespace_to_omegaconf
from fairseq.data import data_utils as fairseq_data_utils
from fairseq im... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/data_utils.py | examples/speech_to_speech/preprocessing/data_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from pathlib import Path
from typing import List, Optional
from examples.speech_to_text.data_utils import S2TDataConfigWriter
def gen_confi... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/prep_sn_data.py | examples/speech_to_speech/preprocessing/prep_sn_data.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Adapted from examples/wav2vec/wav2vec_manifest.py
"""
Data preparation for the speech normalizer
"""
import argpars... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/prep_s2spect_data.py | examples/speech_to_speech/preprocessing/prep_s2spect_data.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
from pathlib import Path
import shutil
import torchaudio
import soundfile as ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/__init__.py | examples/speech_to_speech/preprocessing/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/prep_s2ut_data.py | examples/speech_to_speech/preprocessing/prep_s2ut_data.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
from pathlib import Path
import soundfile as sf
from tqdm import tqdm
import pandas as ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/preprocessing/prep_sn_output_data.py | examples/speech_to_speech/preprocessing/prep_sn_output_data.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from pathlib import Path
from tqdm import tqdm
def process(args):
args.output_root.mkdir(exist_o... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/unity/sequence_generator_multi_decoder.py | examples/speech_to_speech/unity/sequence_generator_multi_decoder.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
from fairseq import search
class Multi... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/unity/__init__.py | examples/speech_to_speech/unity/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import sequence_generator # noqa
from . import sequence_generator_multi_decoder # noqa
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/unity/sequence_generator.py | examples/speech_to_speech/unity/sequence_generator.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import sys
from typing import Dict, List, Optional
import torch
from torch import Tensor
from fairseq.sequence_generator import ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/asr_bleu/compute_asr_bleu.py | examples/speech_to_speech/asr_bleu/compute_asr_bleu.py | import os
from typing import Dict, List
import sacrebleu
import pandas as pd
from glob import glob
from pathlib import Path
from utils import retrieve_asr_config, ASRGenerator
from tqdm import tqdm
from argparse import ArgumentParser
def merge_tailo_init_final(text):
"""
Hokkien ASR hypothesis post-processing... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/asr_bleu/utils.py | examples/speech_to_speech/asr_bleu/utils.py | import json
import re
import urllib.request
from pathlib import Path
import fairseq
import torch
from fairseq.data.data_utils import lengths_to_padding_mask
from tqdm import tqdm
try:
import torchaudio
from torchaudio.models.decoder import ctc_decoder
except ImportError:
raise ImportError("Upgrade torchau... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/asr_bleu/__init__.py | examples/speech_to_speech/asr_bleu/__init__.py | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false | |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/checkpoint_utils.py | fairseq/checkpoint_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import collections
import contextlib
import inspect
import logging
import os
import re
import time
import traceback
from collection... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/search.py | fairseq/search.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import List, Optional
import torch
import torch.nn as nn
from fairseq.token_generation_constraints import (
Cons... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/file_utils.py | fairseq/file_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Utilities for working with the local dataset cache.
This file is adapted from `AllenNLP <https://github.com/allenai/allennlp>`_.
and `hugg... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/registry.py | fairseq/registry.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from argparse import Namespace
from typing import Union
from fairseq.dataclass import FairseqDataclass
from fairseq.dataclass.utils import me... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/incremental_decoding_utils.py | fairseq/incremental_decoding_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import uuid
from typing import Dict, Optional
from torch import Tensor
class FairseqIncrementalState(object):
def __init__(self, *args,... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/nan_detector.py | fairseq/nan_detector.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import torch
logger = logging.getLogger(__name__)
class NanDetector:
"""
Detects the first NaN or Inf in forward a... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/token_generation_constraints.py | fairseq/token_generation_constraints.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Implements tracking of constraints for a beam item.
A list of constraints is given as a list of one or more token
sequences, each of lengt... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/utils.py | fairseq/utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import collections
import contextlib
import copy
import importlib
import logging
import os
import sys
import warnings
from ite... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/hub_utils.py | fairseq/hub_utils.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import copy
import logging
import os
from typing import Any, Dict, Iterator, List
import torch
from... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/binarizer.py | fairseq/binarizer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import typing as tp
from abc import ABC, abstractmethod
from collections import Counter
from dataclasses import datac... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/trainer.py | fairseq/trainer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a network across multiple GPUs.
"""
import contextlib
import logging
import os
import sys
import time
from argparse import Namespac... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/ngram_repeat_block.py | fairseq/ngram_repeat_block.py | # Originally from Microsoft Corporation.
# Licensed under the MIT License.
""" Wrapper for ngram_repeat_block cuda extension """
import math
import warnings
from typing import List
import torch
from torch import nn
try:
from fairseq import ngram_repeat_block_cuda
EXTENSION_BUILT = True
except ImportError:
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/__init__.py | fairseq/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""
import os
import sys
try:
from .version import __version__ # noqa
except ImportError:
version_txt = os.path.jo... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tokenizer.py | fairseq/tokenizer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
SPACE_NORMALIZER = re.compile(r"\s+")
def tokenize_line(line):
line = SPACE_NORMALIZER.sub(" ", line)
line = line.strip(... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/sequence_generator.py | fairseq/sequence_generator.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import sys
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
from fairseq impo... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/file_io.py | fairseq/file_io.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import shutil
from typing import List, Optional
logger = logging.getLogger(__file__)
try:... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/quantization_utils.py | fairseq/quantization_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from fairseq.modules.quantization import pq, quantization_options, scalar
from omegaconf import DictConfig
logger = logging.... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/pdb.py | fairseq/pdb.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing
import os
import pdb
import sys
__all__ = ["set_trace"]
_stdin = [None]
_stdin_lock = multiprocessing.Lock()
try:
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/speech_generator.py | fairseq/speech_generator.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from fairseq.data.audio.speech_to_text_dataset import S2TDataConfig
class SpeechGenerator(object):
def ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/iterative_refinement_generator.py | fairseq/iterative_refinement_generator.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import namedtuple
import numpy as np
import torch
from fairseq import utils
DecoderOut = namedtuple(
"IterativeRefinem... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/file_chunker_utils.py | fairseq/file_chunker_utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import typing as tp
def _safe_readline(fd) -> str:
pos = fd.tell()
while True:
try:
return fd.readline... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/sequence_scorer.py | fairseq/sequence_scorer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import torch
from fairseq import utils
class SequenceScorer(object):
"""Scores the target for a given source sentence."""
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/options.py | fairseq/options.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from pathlib import Path
from typing import Callable, List, Optional, Union
import torch
from fairseq import utils
from fairs... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/semisupervised_translation.py | fairseq/tasks/semisupervised_translation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from collections import OrderedDict
from fairseq import utils
from fairseq.data import (
BacktranslationDataset,... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/translation_from_pretrained_xlm.py | fairseq/tasks/translation_from_pretrained_xlm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass
from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary
from fairseq.tasks.translation impor... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/multilingual_language_modeling.py | fairseq/tasks/multilingual_language_modeling.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Optional
import numpy as np
import torch
from omegaconf ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/multilingual_masked_lm.py | fairseq/tasks/multilingual_masked_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import numpy as np
import torch
from fairseq import utils
from fairseq.data import (
ConcatDataset,
Diction... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/multilingual_denoising.py | fairseq/tasks/multilingual_denoising.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Optional
import numpy as np
from omegaconf import II
fro... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/text_to_speech.py | fairseq/tasks/text_to_speech.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import os.path as op
import torch
import torch.nn.functional as F
import numpy as np
from fairseq.data.audio.text_t... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/fairseq_task.py | fairseq/tasks/fairseq_task.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import warnings
from argparse import Namespace
from typing import Any, Callable, Dict, List
import torch
from fairse... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/speech_to_speech.py | fairseq/tasks/speech_to_speech.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import logging
import math
from argparse import Namespace
from pathlib import Path
from typing import List
import torch
import to... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/span_masked_lm.py | fairseq/tasks/span_masked_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Optional
import numpy as np
from omegaconf import II, MI... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/audio_pretraining.py | fairseq/tasks/audio_pretraining.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import sy... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/denoising.py | fairseq/tasks/denoising.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Any, Optional
import numpy as np
from omegaconf import I... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/multilingual_translation.py | fairseq/tasks/multilingual_translation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import logging
import os
from collections import OrderedDict
from argparse import ArgumentError
import torch
from fairseq i... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/sentence_prediction.py | fairseq/tasks/sentence_prediction.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import contextlib
from dataclasses import dataclass, field
from typing import Optional
from omegaconf import MISSING... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/speech_to_text.py | fairseq/tasks/speech_to_text.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from argparse import Namespace
from pathlib import Path
from typing import List
from fairseq.data import Dictionary, encoders
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/hubert_pretraining.py | fairseq/tasks/hubert_pretraining.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import sy... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/sentence_prediction_adapters.py | fairseq/tasks/sentence_prediction_adapters.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import contextlib
from omegaconf import open_dict, OmegaConf
from fairseq.tasks import register_task
from fairseq.tasks.sente... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/translation.py | fairseq/tasks/translation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
import itertools
import json
import logging
import os
from typing import Optional
from argparse impor... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/nlu_finetuning.py | fairseq/tasks/nlu_finetuning.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import to... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/speech_dlm_task.py | fairseq/tasks/speech_dlm_task.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Optional
from collections import OrderedDict
import nump... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/translation_lev.py | fairseq/tasks/translation_lev.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
import torch
from fairseq import utils
from fairseq.data import LanguagePairDataset
from fairseq.data... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/online_backtranslation.py | fairseq/tasks/online_backtranslation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import json
import logging
import math
import os
from argparse import Namespace
from collections import OrderedDict, default... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/translation_multi_simple_epoch.py | fairseq/tasks/translation_multi_simple_epoch.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import logging
import time
import torch
from fairseq.data import (
FairseqDataset,
LanguagePairDataset,
ListDatas... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/audio_classification.py | fairseq/tasks/audio_classification.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from collections import OrderedDic... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/frm_text_to_speech.py | fairseq/tasks/frm_text_to_speech.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from fairseq.data.audio.frm_text_to_speech_dataset import FrmTextToSpeechDatasetCreator
from fairseq.tasks import register_tas... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/__init__.py | fairseq/tasks/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""
import argparse
import importlib
import os
from fairseq.dataclass import FairseqDataclass
from fairseq.dataclass.utils ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/sentence_ranking.py | fairseq/tasks/sentence_ranking.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import numpy as np
from fairseq import utils
from fairseq.data import (
ConcatSentencesDataset,
Dictionary,
... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/masked_lm.py | fairseq/tasks/masked_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
import numpy as np
from omegaconf import II, MISSING, OmegaConf
from fairs... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/language_modeling.py | fairseq/tasks/language_modeling.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
from typing import Optional
import numpy as np
import torch
from fairseq im... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/speech_ulm_task.py | fairseq/tasks/speech_ulm_task.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import sys
import t... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/audio_finetuning.py | fairseq/tasks/audio_finetuning.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
from fair... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/translation_from_pretrained_bart.py | fairseq/tasks/translation_from_pretrained_bart.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import utils
from fairseq.data import LanguagePairDataset
from . import register_task
from .translation import Tran... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/legacy_masked_lm.py | fairseq/tasks/legacy_masked_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
import numpy as np
from fairseq import tokenizer, utils
from fairseq.data import ConcatDataset, Dic... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/cross_lingual_lm.py | fairseq/tasks/cross_lingual_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
from collections import OrderedDict
import numpy as np
from fairseq import tokenizer, utils
from fa... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/multires_hubert_pretraining.py | fairseq/tasks/multires_hubert_pretraining.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import sy... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/tasks/simultaneous_translation.py | fairseq/tasks/simultaneous_translation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from fairseq.tasks import register_task
from fairseq.tasks.speech_to_text import SpeechToTextTask
from fairseq.tasks.translatio... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/__init__.py | fairseq/model_parallel/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import criterions, models, modules # noqa
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/megatron_trainer.py | fairseq/model_parallel/megatron_trainer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a network across multiple GPUs.
"""
from fairseq.dataclass.configs import FairseqConfig
from fairseq.distributed import utils as di... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/transformer_lm.py | fairseq/model_parallel/models/transformer_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch.nn as nn
from fairseq.model_parallel.models.transformer import ModelParallelTransformerDecoder
from fairseq.models import regist... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/__init__.py | fairseq/model_parallel/models/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import importlib
import os
# automatically import any Python files in the models/ directory
models_dir = os.path.dirname(__file__)
for file ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/transformer.py | fairseq/model_parallel/models/transformer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import torch.nn as nn
from fairseq.model_parallel.modules import (
ModelParallelTransformerDecoderLayer,
ModelParalle... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/roberta/model.py | fairseq/model_parallel/models/roberta/model.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
RoBERTa: A Robustly Optimized BERT Pretraining Approach.
"""
import logging
import torch
import torch.nn as nn
import torch.nn.functional... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/roberta/__init__.py | fairseq/model_parallel/models/roberta/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .model import * # noqa
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/pipeline_parallel_transformer/model.py | fairseq/model_parallel/models/pipeline_parallel_transformer/model.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import utils
from fairseq.model_parallel.model... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/pipeline_parallel_transformer/__init__.py | fairseq/model_parallel/models/pipeline_parallel_transformer/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .model import * # noqa
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/models/pipeline_parallel_transformer/layers.py | fairseq/model_parallel/models/pipeline_parallel_transformer/layers.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import option... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/criterions/vocab_parallel_cross_entropy.py | fairseq/model_parallel/criterions/vocab_parallel_cross_entropy.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from fairseq import utils
from fairseq.logging import metrics
from fairseq.criterions import FairseqCriterion, register_criterion... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/criterions/__init__.py | fairseq/model_parallel/criterions/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import importlib
import os
# automatically import any Python files in the criterions/ directory
for file in sorted(os.listdir(os.path.dirnam... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/modules/transformer_layer.py | fairseq/model_parallel/modules/transformer_layer.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from fairseq.model_parallel.modules import ModelParallelMultiheadAttention
from fairseq.modules import TransformerDecoderLayer, TransformerEnc... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/modules/multihead_attention.py | fairseq/model_parallel/modules/multihead_attention.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import Tensor, nn
from fairseq import utils... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/model_parallel/modules/__init__.py | fairseq/model_parallel/modules/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""
from .multihead_attention import ModelParallelMultiheadAttention
from .transformer_layer import (
ModelParallelTrans... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/dataclass/constants.py | fairseq/dataclass/constants.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from enum import Enum, EnumMeta
from typing import List
class StrEnumMeta(EnumMeta):
# this is workaround for submitit pickling leading ... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/dataclass/configs.py | fairseq/dataclass/configs.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
from dataclasses import _MISSING_TYPE, dataclass, field
from typing import Any, List, Optional
import torch
from omegaco... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | true |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/dataclass/utils.py | fairseq/dataclass/utils.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import inspect
import logging
import os
import re
from argparse import ArgumentError, ArgumentParser, Namespace
from dataclasses im... | python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
facebookresearch/fairseq | https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/fairseq/dataclass/__init__.py | fairseq/dataclass/__init__.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .configs import FairseqDataclass
from .constants import ChoiceEnum
__all__ = [
"FairseqDataclass",
"ChoiceEnum",
]
| python | MIT | 3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99 | 2026-01-04T14:42:59.188867Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.