Merge pull request #223920 from bcdarwin/python3-peft

python310Packages.peft: init at 0.2.0
This commit is contained in:
Mario Rodas 2023-04-24 20:38:59 -05:00 committed by GitHub
commit aa967b00ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,74 @@
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, setuptools
, numpy
, packaging
, psutil
, pyyaml
, torch
, evaluate
, parameterized
, transformers
}:
buildPythonPackage rec {
pname = "accelerate";
version = "0.18.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "huggingface";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-fCIvVbMaWAWzRfPc5/1CZq3gZ8kruuk9wBt8mzLHmyw=";
};
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
numpy
packaging
psutil
pyyaml
torch
];
nativeCheckInputs = [
evaluate
parameterized
pytestCheckHook
transformers
];
preCheck = ''
export HOME=$(mktemp -d)
export PATH=$out/bin:$PATH
'';
pytestFlagsArray = [ "tests" ];
disabledTests = [
# try to download data:
"FeatureExamplesTests"
"test_infer_auto_device_map_on_t0pp"
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
# usual aarch64-linux RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly
"CheckpointTest"
];
# numerous instances of torch.multiprocessing.spawn.ProcessRaisedException:
doCheck = !stdenv.isDarwin;
pythonImportsCheck = [
"accelerate"
];
meta = with lib; {
homepage = "https://huggingface.co/docs/accelerate";
description = "A simple way to train and use PyTorch models with multi-GPU, TPU, mixed-precision";
changelog = "https://github.com/huggingface/accelerate/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ bcdarwin ];
mainProgram = "accelerate";
};
}

View File

@ -0,0 +1,54 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, setuptools
, numpy
, packaging
, psutil
, pyyaml
, torch
, transformers
, accelerate
}:
buildPythonPackage rec {
pname = "peft";
version = "0.2.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "huggingface";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-NPpY29HMQe5KT0JdlLAXY9MVycDslbP2i38NSTirB3I=";
};
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
numpy
packaging
psutil
pyyaml
torch
transformers
accelerate
];
doCheck = false; # tried to download pretrained model
pythonImportsCheck = [
"peft"
];
meta = with lib; {
homepage = "https://github.com/huggingface/peft";
description = "State-of-the art parameter-efficient fine tuning";
changelog = "https://github.com/huggingface/peft/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ bcdarwin ];
};
}

View File

@ -22,6 +22,8 @@ self: super: with self; {
accessible-pygments = callPackage ../development/python-modules/accessible-pygments { };
accelerate = callPackage ../development/python-modules/accelerate { };
accuweather = callPackage ../development/python-modules/accuweather { };
accupy = callPackage ../development/python-modules/accupy { };
@ -7213,6 +7215,8 @@ self: super: with self; {
pefile = callPackage ../development/python-modules/pefile { };
peft = callPackage ../development/python-modules/peft { };
pelican = callPackage ../development/python-modules/pelican {
inherit (pkgs) glibcLocales git;
};