nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

python310Packages.ctranslate2: init at 3.15.1

Python bindings for ctranslate2.

+88
+84
pkgs/development/python-modules/ctranslate2/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + 4 + # build-system 5 + , pybind11 6 + , setuptools 7 + 8 + # dependencies 9 + , ctranslate2-cpp 10 + , numpy 11 + , pyyaml 12 + 13 + # tests 14 + , pytestCheckHook 15 + , tensorflow 16 + , torch 17 + , transformers 18 + , wurlitzer 19 + }: 20 + 21 + buildPythonPackage rec { 22 + inherit (ctranslate2-cpp) pname version src; 23 + format = "setuptools"; 24 + 25 + # https://github.com/OpenNMT/CTranslate2/tree/master/python 26 + sourceRoot = "source/python"; 27 + 28 + nativeBuildInputs = [ 29 + pybind11 30 + setuptools 31 + ]; 32 + 33 + buildInputs = [ 34 + ctranslate2-cpp 35 + ]; 36 + 37 + propagatedBuildInputs = [ 38 + numpy 39 + pyyaml 40 + ]; 41 + 42 + pythonImportsCheck = [ 43 + # https://opennmt.net/CTranslate2/python/overview.html 44 + "ctranslate2" 45 + "ctranslate2.converters" 46 + "ctranslate2.models" 47 + "ctranslate2.specs" 48 + ]; 49 + 50 + nativeCheckInputs = [ 51 + pytestCheckHook 52 + tensorflow 53 + torch 54 + transformers 55 + wurlitzer 56 + ]; 57 + 58 + preCheck = '' 59 + # run tests against build result, not sources 60 + rm -rf ctranslate2 61 + 62 + export HOME=$TMPDIR 63 + ''; 64 + 65 + disabledTests = [ 66 + # AssertionError: assert 'int8' in {'float32'} 67 + "test_get_supported_compute_types" 68 + ]; 69 + 70 + disabledTestPaths = [ 71 + # TODO: ModuleNotFoundError: No module named 'opennmt' 72 + "tests/test_opennmt_tf.py" 73 + # OSError: We couldn't connect to 'https://huggingface.co' to load this file 74 + "tests/test_transformers.py" 75 + ]; 76 + 77 + meta = with lib; { 78 + description = "Fast inference engine for Transformer models"; 79 + homepage = "https://github.com/OpenNMT/CTranslate2"; 80 + changelog = "https://github.com/OpenNMT/CTranslate2/blob/${src.rev}/CHANGELOG.md"; 81 + license = licenses.mit; 82 + maintainers = with maintainers; [ hexa ]; 83 + }; 84 + }
+4
pkgs/top-level/python-packages.nix
··· 2218 2218 2219 2219 ctap-keyring-device = callPackage ../development/python-modules/ctap-keyring-device { }; 2220 2220 2221 + ctranslate2 = callPackage ../development/python-modules/ctranslate2 { 2222 + ctranslate2-cpp = pkgs.ctranslate2; 2223 + }; 2224 + 2221 2225 cu2qu = callPackage ../development/python-modules/cu2qu { }; 2222 2226 2223 2227 cucumber-tag-expressions = callPackage ../development/python-modules/cucumber-tag-expressions { };