diff --git a/MICROLIB.md b/MICROLIB.md index ef6d41d..d069530 100644 --- a/MICROLIB.md +++ b/MICROLIB.md @@ -71,7 +71,7 @@ this example: ```python import numpy as np -from mmap_ninja import numpy as np_ninja +from src.mmap_ninja import numpy as np_ninja arr = np.random.randn(200, 224, 224, 3) np_ninja.from_ndarray('imgs_mmap', arr) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..98813a1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +# pyproject.toml + +[build-system] +requires = ["setuptools>=61.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "mmap_ninja" +version = "0.7.1" +description = "Microlib for converting LLM weights into sepweight format" +readme = "README.md" +authors = [{ name = "Hristo Vrigazov", email = "hvrigazov@gmail.com" }] +license = { file = "LICENSE" } +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] +dependencies = ["torch"] +requires-python = ">=3.8" + +[project.urls] +Homepage = "https://github.com/microlib-org/llm_microlibs/llm_sepweight" + +[project.optional-dependencies] +dev = ["safetensors", "pytest", "tqdm", "pytest-dotenv"] diff --git a/mmap_ninja/__init__.py b/src/mmap_ninja/__init__.py similarity index 100% rename from mmap_ninja/__init__.py rename to src/mmap_ninja/__init__.py diff --git a/mmap_ninja/base.py b/src/mmap_ninja/base.py similarity index 100% rename from mmap_ninja/base.py rename to src/mmap_ninja/base.py diff --git a/mmap_ninja/generic.py b/src/mmap_ninja/generic.py similarity index 95% rename from mmap_ninja/generic.py rename to src/mmap_ninja/generic.py index a96499d..5c3b5c4 100644 --- a/mmap_ninja/generic.py +++ b/src/mmap_ninja/generic.py @@ -1,5 +1,5 @@ from mmap_ninja import base -from mmap_ninja import numpy as np_ninja +from src.mmap_ninja import numpy as np_ninja from mmap_ninja.base import Wrapped from mmap_ninja.string import StringsMmap from mmap_ninja.ragged import RaggedMmap diff --git a/mmap_ninja/numpy.py b/src/mmap_ninja/numpy.py similarity index 100% rename from mmap_ninja/numpy.py rename to src/mmap_ninja/numpy.py diff --git a/mmap_ninja/ragged.py b/src/mmap_ninja/ragged.py similarity index 99% rename from mmap_ninja/ragged.py rename to src/mmap_ninja/ragged.py index 051f7b3..15eb514 100644 --- a/mmap_ninja/ragged.py +++ b/src/mmap_ninja/ragged.py @@ -4,7 +4,8 @@ import numpy as np -from mmap_ninja import numpy, base +from mmap_ninja import base +from src.mmap_ninja import numpy def _np_shape_extend(shapes, arr): diff --git a/mmap_ninja/string.py b/src/mmap_ninja/string.py similarity index 98% rename from mmap_ninja/string.py rename to src/mmap_ninja/string.py index 0999b67..4c0d718 100644 --- a/mmap_ninja/string.py +++ b/src/mmap_ninja/string.py @@ -4,7 +4,8 @@ import numpy as np -from mmap_ninja import numpy, base +from mmap_ninja import base +from src.mmap_ninja import numpy from mmap_ninja.base import _bytes_to_str, _str_to_bytes, _sequence_of_strings_to_bytes diff --git a/tests/test_numpy.py b/tests/test_numpy.py index 4c97899..8243656 100644 --- a/tests/test_numpy.py +++ b/tests/test_numpy.py @@ -3,7 +3,8 @@ import numpy as np -from mmap_ninja import numpy as np_ninja, generic +from mmap_ninja import generic +from src.mmap_ninja import numpy as np_ninja def test_numpy(tmp_path):