python310Packages.fairseq: init at 0.12.3 (#242398)

* python310Packages.fairseq: init at 0.12.3

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

fairseq: formatting fix

* Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

* Update pkgs/development/python-modules/fairseq/default.nix

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>

---------

Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>
This commit is contained in:
Yt 2023-07-12 09:47:53 +08:00 committed by GitHub
parent 7f87165685
commit a155c31592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,106 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
# Native build inputs
, cython
, pythonRelaxDepsHook
, which
# Propagated build inputs
, cffi
, hydra-core
, omegaconf
, sacrebleu
, numpy
, regex
, torch
, tqdm
, bitarray
, torchaudio
, scikit-learn
, packaging
# Check inputs
, expecttest
, hypothesis
, pytestCheckHook
}:
let
pname = "fairseq";
version = "0.12.3";
in
buildPythonPackage rec {
inherit version pname;
src = fetchFromGitHub {
owner = "pytorch";
repo = pname;
rev = "v${version}";
hash = "sha256-XX/grU5ljQCwx33miGoFc/7Uj9fZDtmhm4Fz7L4U+Bc=";
};
disabled = pythonOlder "3.7";
nativeBuildInputs = [
cython
pythonRelaxDepsHook
which
];
pythonRelaxDeps = [
"hydra-core"
"omegaconf"
];
propagatedBuildInputs = [
cffi
hydra-core
omegaconf
sacrebleu
numpy
regex
torch
tqdm
bitarray
torchaudio
scikit-learn
packaging
];
nativeCheckInputs = [
expecttest
hypothesis
pytestCheckHook
];
pythonImportsCheck = [ "fairseq" ];
preCheck = ''
export HOME=$TMPDIR
cd tests
'';
pytestFlagsArray = [
"--import-mode append"
];
disabledTests = [
# this test requires xformers
"test_xformers_single_forward_parity"
# this test requires iopath
"test_file_io_async"
# these tests require network access
"test_s2s_transformer_checkpoint"
"test_librispeech_s2t_transformer_s_checkpoint"
"test_s2s_transformer_checkpoint"
"test_waitk_checkpoint"
"test_sotasty_es_en_600m_checkpoint"
"test_librispeech_s2t_conformer_s_checkpoint"
];
meta = with lib; {
description = "Facebook AI Research Sequence-to-Sequence Toolkit";
homepage = "https://github.com/pytorch/fairseq";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -3521,6 +3521,8 @@ self: super: with self; {
fairscale = callPackage ../development/python-modules/fairscale { };
fairseq = callPackage ../development/python-modules/fairseq { };
faiss = toPythonModule (pkgs.faiss.override {
pythonSupport = true;
pythonPackages = self;