Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/accelerate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@

buildPythonPackage rec {
pname = "accelerate";
version = "1.3.0";
version = "1.5.2";
pyproject = true;

src = fetchFromGitHub {
owner = "huggingface";
repo = "accelerate";
tag = "v${version}";
hash = "sha256-HcbvQL8nASsZcfjAoPbQKNoEkSLp5Vmus2MEa3Dv6Po=";
hash = "sha256-J4eDm/PcyKK3256l6CAWUj4AWTB6neTKgxbBmul0BPE=";
};

buildInputs = [ llvmPackages.openmp ];
Expand All @@ -67,7 +67,7 @@ buildPythonPackage rec {
];

preCheck = lib.optionalString config.cudaSupport ''
export TRITON_PTXAS_PATH="${cudatoolkit}/bin/ptxas"
export TRITON_PTXAS_PATH="${lib.getExe' cudatoolkit "ptxas"}"
'';
pytestFlagsArray = [ "tests" ];
disabledTests =
Expand Down
25 changes: 15 additions & 10 deletions pkgs/development/python-modules/gradio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,21 @@ buildPythonPackage rec {
"test_updates_stored_up_to_capacity"
"test_varying_output_forms_with_generators"
];
disabledTestPaths = [
# 100% touches network
"test/test_networking.py"
"client/python/test/test_client.py"
# makes pytest freeze 50% of the time
"test/test_interfaces.py"

# Local network tests dependant on port availability (port 7860-7959)
"test/test_routes.py"
];
disabledTestPaths =
[
# 100% touches network
"test/test_networking.py"
"client/python/test/test_client.py"
# makes pytest freeze 50% of the time
"test/test_interfaces.py"

# Local network tests dependant on port availability (port 7860-7959)
"test/test_routes.py"
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
# No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
"test/test_pipelines.py"
];
pytestFlagsArray = [
"-x" # abort on first failure
"-m 'not flaky'"
Expand Down
90 changes: 75 additions & 15 deletions pkgs/development/python-modules/peft/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,111 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,

# build-system
setuptools,

# dependencies
accelerate,
huggingface-hub,
numpy,
packaging,
psutil,
pyyaml,
safetensors,
torch,
tqdm,
transformers,
accelerate,

# tests
datasets,
diffusers,
parameterized,
pytest-cov-stub,
pytest-xdist,
pytestCheckHook,
scipy,
}:

buildPythonPackage rec {
pname = "peft";
version = "0.14.0";
format = "pyproject";

disabled = pythonOlder "3.8";
version = "0.15.0";
pyproject = true;

src = fetchFromGitHub {
owner = "huggingface";
repo = pname;
repo = "peft";
tag = "v${version}";
hash = "sha256-Bo8nqhxL6st/Nk9wSqly7FH+RNkT0baB+1bbTIolUis=";
hash = "sha256-vR0FoBDsSMQiSGgqMegPqPvDgq00fqF7d+jKvqgeCAg=";
};

nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];

propagatedBuildInputs = [
dependencies = [
accelerate
huggingface-hub
numpy
packaging
psutil
pyyaml
safetensors
torch
tqdm
transformers
accelerate
];

doCheck = false; # tries to download pretrained models
pythonImportsCheck = [ "peft" ];

meta = with lib; {
nativeCheckInputs = [
datasets
diffusers
parameterized
pytest-cov-stub
pytest-xdist
pytestCheckHook
scipy
];

pytestFlagsArray = [ "tests" ];

disabledTestPaths = [
# ValueError: Can't find 'adapter_config.json'
"tests/test_config.py"

# Require internet access to download a dataset
"tests/test_adaption_prompt.py"
"tests/test_auto.py"
"tests/test_boft.py"
"tests/test_cpt.py"
"tests/test_custom_models.py"
"tests/test_decoder_models.py"
"tests/test_encoder_decoder_models.py"
"tests/test_feature_extraction_models.py"
"tests/test_helpers.py"
"tests/test_hub_features.py"
"tests/test_incremental_pca.py"
"tests/test_initialization.py"
"tests/test_mixed.py"
"tests/test_multitask_prompt_tuning.py"
"tests/test_other.py"
"tests/test_other.py"
"tests/test_poly.py"
"tests/test_stablediffusion.py"
"tests/test_trainable_tokens.py"
"tests/test_tuners_utils.py"
"tests/test_vision_models.py"
"tests/test_xlora.py"
];

meta = {
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 ];
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bcdarwin ];
badPlatforms = [
# No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
lib.systems.inspect.patterns.isDarwin
];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,

# build-system
setuptools,
Expand All @@ -15,8 +14,6 @@
pillow,
scikit-learn,
scipy,
sentencepiece,
tokenizers,
torch,
tqdm,
transformers,
Expand All @@ -31,8 +28,6 @@ buildPythonPackage rec {
version = "3.4.1";
pyproject = true;

disabled = pythonOlder "3.9";

src = fetchFromGitHub {
owner = "UKPLab";
repo = "sentence-transformers";
Expand Down Expand Up @@ -114,5 +109,9 @@ buildPythonPackage rec {
changelog = "https://github.com/UKPLab/sentence-transformers/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dit7ya ];
badPlatforms = [
# No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
lib.systems.inspect.patterns.isDarwin
];
};
}
17 changes: 16 additions & 1 deletion pkgs/development/python-modules/smolagents/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
pytest-datadir,
pytestCheckHook,
python-dotenv,
rank-bm25,
requests,
rich,
setuptools,
Expand Down Expand Up @@ -127,8 +126,24 @@ buildPythonPackage rec {
++ lib.optionals stdenv.isDarwin [
# Missing dependencies
"test_get_mlx"

# Fatal Python error: Aborted
# thread '<unnamed>' panicked, Attempted to create a NULL object.
# duckduckgo_search/duckduckgo_search.py", line 83 in __init__
"TestDuckDuckGoSearchTool"
"test_init_agent_with_different_toolsets"
"test_multiagents_save"
"test_new_instance"
];

disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
"tests/test_final_answer.py"
"tests/test_types.py"
];

__darwinAllowLocalNetworking = true;

meta = {
description = "Barebones library for agents";
homepage = "https://github.com/huggingface/smolagents";
Expand Down