lol

python3Packages.{compressed-tensors,mistral-common,partial-json-parser}: init (#378782)

authored by

Pavol Rusnak and committed by
GitHub
5daad7e2 8b564bb2

+171
+66
pkgs/development/python-modules/compressed-tensors/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchFromGitHub, 5 + setuptools, 6 + pydantic, 7 + torch, 8 + transformers, 9 + nbconvert, 10 + nbformat, 11 + pytestCheckHook, 12 + }: 13 + 14 + buildPythonPackage rec { 15 + pname = "compressed-tensors"; 16 + version = "0.9.1"; 17 + pyproject = true; 18 + 19 + # Release on PyPI is missing the `utils` directory, which `setup.py` wants to import 20 + src = fetchFromGitHub { 21 + owner = "neuralmagic"; 22 + repo = pname; 23 + tag = version; 24 + hash = "sha256-AsbNFBvHxjiLl0T4JnQ5QrZdERUUYgS4iJvMRQytzN4="; 25 + }; 26 + 27 + build-system = [ setuptools ]; 28 + 29 + dependencies = [ 30 + pydantic 31 + torch 32 + transformers 33 + ]; 34 + 35 + doCheck = true; 36 + 37 + pythonImportsCheck = [ "compressed_tensors" ]; 38 + 39 + nativeCheckInputs = [ 40 + nbconvert 41 + nbformat 42 + pytestCheckHook 43 + ]; 44 + 45 + disabledTests = [ 46 + # these try to download models from HF Hub 47 + "test_get_observer_token_count" 48 + "test_kv_cache_quantization" 49 + "test_target_prioritization" 50 + "test_load_compressed_sharded" 51 + "test_save_compressed_model" 52 + "test_apply_tinyllama_dynamic_activations" 53 + ]; 54 + 55 + disabledTestPaths = [ 56 + # these try to download models from HF Hub 57 + "tests/test_quantization/lifecycle/test_apply.py" 58 + ]; 59 + 60 + meta = with lib; { 61 + description = "A safetensors extension to efficiently store sparse quantized tensors on disk"; 62 + homepage = "https://github.com/neuralmagic/compressed-tensors"; 63 + license = licenses.asl20; 64 + maintainers = [ ]; 65 + }; 66 + }
+57
pkgs/development/python-modules/mistral-common/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchPypi, 5 + poetry-core, 6 + numpy, 7 + pydantic, 8 + jsonschema, 9 + sentencepiece, 10 + typing-extensions, 11 + tiktoken, 12 + pillow, 13 + requests, 14 + }: 15 + 16 + buildPythonPackage rec { 17 + pname = "mistral-common"; 18 + version = "1.5.2"; 19 + pyproject = true; 20 + 21 + src = fetchPypi { 22 + pname = "mistral_common"; 23 + inherit version; 24 + hash = "sha256-nRFXsTdsSdNav8dD2+AITyyjezpavQPnQSdqG8ZshS8="; 25 + }; 26 + 27 + # relax dependencies 28 + postPatch = '' 29 + substituteInPlace pyproject.toml \ 30 + --replace-fail 'pillow = "^10.3.0"' 'pillow = ">=10.3.0"' \ 31 + --replace-fail 'tiktoken = "^0.7.0"' 'tiktoken = ">=0.7.0"' \ 32 + ''; 33 + 34 + build-system = [ poetry-core ]; 35 + 36 + dependencies = [ 37 + numpy 38 + pydantic 39 + jsonschema 40 + sentencepiece 41 + typing-extensions 42 + tiktoken 43 + pillow 44 + requests 45 + ]; 46 + 47 + doCheck = true; 48 + 49 + pythonImportsCheck = [ "mistral_common" ]; 50 + 51 + meta = with lib; { 52 + description = "mistral-common is a set of tools to help you work with Mistral models."; 53 + homepage = "https://github.com/mistralai/mistral-common"; 54 + license = licenses.asl20; 55 + maintainers = with maintainers; [ bgamari ]; 56 + }; 57 + }
+42
pkgs/development/python-modules/partial-json-parser/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchPypi, 5 + pdm-backend, 6 + tqdm, 7 + hypothesis, 8 + pytest, 9 + }: 10 + 11 + buildPythonPackage rec { 12 + pname = "partial-json-parser"; 13 + version = "0.2.1.1.post5"; 14 + pyproject = true; 15 + 16 + src = fetchPypi { 17 + pname = "partial_json_parser"; 18 + inherit version; 19 + hash = "sha256-mScQrGfpCzZ5IdUnJ2mJKAQPdxO6fsszuWNx6nrsgso="; 20 + }; 21 + 22 + build-system = [ pdm-backend ]; 23 + 24 + dependencies = [ ]; 25 + 26 + doCheck = true; 27 + 28 + pythonImportsCheck = [ "partial_json_parser" ]; 29 + 30 + dev-dependencies = [ 31 + hypothesis 32 + tqdm 33 + pytest 34 + ]; 35 + 36 + meta = with lib; { 37 + description = "Parse partial JSON generated by LLM"; 38 + homepage = "https://github.com/promplate/partial-json-parser"; 39 + license = licenses.mit; 40 + maintainers = [ ]; 41 + }; 42 + }
+6
pkgs/top-level/python-packages.nix
··· 2586 2586 2587 2587 compressed-rtf = callPackage ../development/python-modules/compressed-rtf { }; 2588 2588 2589 + compressed-tensors = callPackage ../development/python-modules/compressed-tensors { }; 2590 + 2589 2591 concurrent-log-handler = callPackage ../development/python-modules/concurrent-log-handler { }; 2590 2592 2591 2593 conda = callPackage ../development/python-modules/conda { }; ··· 8276 8278 8277 8279 mistletoe = callPackage ../development/python-modules/mistletoe { }; 8278 8280 8281 + mistral-common = callPackage ../development/python-modules/mistral-common { }; 8282 + 8279 8283 mistune = callPackage ../development/python-modules/mistune { }; 8280 8284 8281 8285 mitmproxy = callPackage ../development/python-modules/mitmproxy { }; ··· 10087 10091 parsy = callPackage ../development/python-modules/parsy { }; 10088 10092 10089 10093 partd = callPackage ../development/python-modules/partd { }; 10094 + 10095 + partial-json-parser = callPackage ../development/python-modules/partial-json-parser { }; 10090 10096 10091 10097 parts = callPackage ../development/python-modules/parts { }; 10092 10098