Something went wrong. Try again.
lol
Something went wrong. Try again.
2.0 kB · 95 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596{ lib, buildPythonPackage, fetchFromGitHub,
# build-system setuptools,
# dependencies jinja2, mlx, numpy, protobuf, pyyaml, transformers,
# tests aiohttp, lm-eval, pytestCheckHook, sentencepiece, writableTmpDirAsHomeHook,}:
buildPythonPackage (finalAttrs: { pname = "mlx-lm"; version = "0.31.3"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "ml-explore"; repo = "mlx-lm"; tag = "v${finalAttrs.version}"; hash = "sha256-DPOJfsIucG8mWt4ZKenymCJo/i9Jw+a+iuIygIIYkA8="; };
build-system = [ setuptools ];
pythonRelaxDeps = [ "transformers" ]; dependencies = [ jinja2 mlx numpy protobuf pyyaml transformers ];
nativeCheckInputs = [ aiohttp lm-eval pytestCheckHook sentencepiece writableTmpDirAsHomeHook ];
pythonImportsCheck = [ "mlx_lm" ];
disabledTestPaths = [ # Requires network access to huggingface.co "tests/test_datsets.py" "tests/test_generate.py" "tests/test_prompt_cache.py::TestPromptCache" "tests/test_server.py" "tests/test_tokenizers.py" "tests/test_utils.py::TestUtils::test_convert" "tests/test_utils.py::TestUtils::test_load"
# RuntimeError: [metal_kernel] No GPU back-end. "tests/test_losses.py" "tests/test_models.py::TestModels::test_bitnet"
# TypeError: 'NoneType' object is not callable "tests/test_models.py::TestModels::test_gated_delta" "tests/test_models.py::TestModels::test_gated_delta_masked" ];
disabledTests = [ # ValueError: [rope] dims must be positive but got 0 # Reported upstream: https://github.com/ml-explore/mlx-lm/issues/1089 "test_all_models" ];
meta = { description = "Run LLMs with MLX"; homepage = "https://github.com/ml-explore/mlx-lm"; changelog = "https://github.com/ml-explore/mlx-lm/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; };})