diff --git a/gguf-py/gguf/quants.py b/gguf-py/gguf/quants.py index cc0772913bec..359e279f006c 100644 --- a/gguf-py/gguf/quants.py +++ b/gguf-py/gguf/quants.py @@ -42,7 +42,8 @@ def _apply_over_grouped_rows(func: Callable[[np.ndarray], np.ndarray], arr: np.n # round away from zero # ref: https://stackoverflow.com/a/59143326/22827863 def np_roundf(n: np.ndarray) -> np.ndarray: - a = abs(n) + # np.abs, not abs(): numpy < 2.3 on Python 3.14 can write abs() in place into n when the caller passes a temporary (numpy/numpy#28681), dropping the sign + a = np.abs(n) floored = np.floor(a) b = floored + np.floor(2 * (a - floored)) return np.sign(n) * b diff --git a/gguf-py/pyproject.toml b/gguf-py/pyproject.toml index 07e6f7fee82d..538746817550 100644 --- a/gguf-py/pyproject.toml +++ b/gguf-py/pyproject.toml @@ -7,7 +7,7 @@ dynamic = ["classifiers"] readme = "README.md" authors = [{name = "GGML", email = "ggml@ggml.ai"}] requires-python = '>=3.10' -dependencies = ['numpy (>=2.2.6)', 'tqdm (>=4.27)', 'pyyaml (>=5.1)', 'requests (>=2.25)'] +dependencies = ['numpy (>=2.2.6); python_version < "3.14"', 'numpy (>=2.3.0); python_version >= "3.14"', 'tqdm (>=4.27)', 'pyyaml (>=5.1)', 'requests (>=2.25)'] classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", diff --git a/pyproject.toml b/pyproject.toml index 158ce1623648..996529753e45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,8 @@ readme = "README.md" authors = [{name = "GGML", email = "ggml@ggml.ai"}] requires-python = '>=3.10,<3.15' dependencies = [ - 'numpy (>=2.2.6,<3.0.0)', + 'numpy (>=2.2.6,<3.0.0); python_version < "3.14"', + 'numpy (>=2.3.0,<3.0.0); python_version >= "3.14"', 'sentencepiece (>=0.1.98,<0.3.0)', 'transformers (==4.57.6)', 'protobuf (>=4.21.0,<5.0.0)', diff --git a/requirements/requirements-convert_legacy_llama.txt b/requirements/requirements-convert_legacy_llama.txt index edc945c1cb67..9186f361eb5d 100644 --- a/requirements/requirements-convert_legacy_llama.txt +++ b/requirements/requirements-convert_legacy_llama.txt @@ -1,4 +1,5 @@ -numpy~=2.2.6 +numpy~=2.2.6; python_version < "3.14" +numpy~=2.4.6; python_version >= "3.14" sentencepiece>=0.1.98,<0.3.0 transformers==4.57.6 diff --git a/tools/server/tests/requirements.txt b/tools/server/tests/requirements.txt index 5e6dff298f4e..e437876cabdd 100644 --- a/tools/server/tests/requirements.txt +++ b/tools/server/tests/requirements.txt @@ -2,7 +2,8 @@ aiohttp~=3.9.3 pytest~=8.3.3 pytest-xdist~=3.6 filelock~=3.16 -numpy~=2.2.6 +numpy~=2.2.6; python_version < "3.14" +numpy~=2.4.6; python_version >= "3.14" openai~=2.14.0 prometheus-client~=0.20.0 requests~=2.32.3