Unverified Commit f7d113df authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python312Packages.accelerate: 1.3.0 -> 1.5.2 (#393024)

parents 7fbac1f4 3a68fa20
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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 ];
@@ -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 =
+15 −10
Original line number Diff line number Diff line
@@ -301,7 +301,8 @@ buildPythonPackage rec {
      "test_updates_stored_up_to_capacity"
      "test_varying_output_forms_with_generators"
    ];
  disabledTestPaths = [
  disabledTestPaths =
    [
      # 100% touches network
      "test/test_networking.py"
      "client/python/test/test_client.py"
@@ -310,6 +311,10 @@ buildPythonPackage rec {

      # 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
+75 −15
Original line number Diff line number Diff line
@@ -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
    ];
  };
}
+4 −5
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,

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

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "UKPLab";
    repo = "sentence-transformers";
@@ -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
    ];
  };
}
+16 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
  pytest-datadir,
  pytestCheckHook,
  python-dotenv,
  rank-bm25,
  requests,
  rich,
  setuptools,
@@ -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";