aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2026-04-07 15:08:45 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2026-04-07 19:19:13 +0000
commit24c58c7723461927079617f6bc075df768e8ff65 (patch)
tree982f80dc48873d450235b4ebab852a6fda821544
parent842be181cfdb63455a8c4e7c2f97b0f524952983 (diff)
misc/py-compressed-tensors: New port: Library for storing and loading compressed PyTorch models
-rw-r--r--misc/Makefile1
-rw-r--r--misc/py-compressed-tensors/Makefile31
-rw-r--r--misc/py-compressed-tensors/distinfo3
-rw-r--r--misc/py-compressed-tensors/files/patch-pyproject.toml9
-rw-r--r--misc/py-compressed-tensors/files/patch-setup.py11
-rw-r--r--misc/py-compressed-tensors/pkg-descr3
6 files changed, 58 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 51b11a8a3156..2dadb25668f2 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -458,6 +458,7 @@
SUBDIR += py-comfyui-workflow-templates-media-image
SUBDIR += py-comfyui-workflow-templates-media-other
SUBDIR += py-comfyui-workflow-templates-media-video
+ SUBDIR += py-compressed-tensors
SUBDIR += py-cppman
SUBDIR += py-crudini
SUBDIR += py-csvw
diff --git a/misc/py-compressed-tensors/Makefile b/misc/py-compressed-tensors/Makefile
new file mode 100644
index 000000000000..4ea4cb293c8f
--- /dev/null
+++ b/misc/py-compressed-tensors/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= compressed-tensors
+DISTVERSION= 0.14.0.1
+CATEGORIES= misc python # machine-learning
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= ${PORTNAME:S/-/_/}-${DISTVERSION}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Library for storing and loading compressed PyTorch models
+WWW= https://github.com/vllm-project/compressed-tensors
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}setuptools-scm>=8.0:devel/py-setuptools-scm@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}loguru>0:devel/py-loguru@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pydantic2>=2.0:devel/py-pydantic2@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytorch>=1.7.0:misc/py-pytorch@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}transformers>=4.0.0:misc/py-transformers@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= pep517 autoplist pytest
+
+NO_ARCH= yes
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_WRKSRC= ${WRKSRC}/tests
+
+.include <bsd.port.mk>
diff --git a/misc/py-compressed-tensors/distinfo b/misc/py-compressed-tensors/distinfo
new file mode 100644
index 000000000000..c8d301932f2a
--- /dev/null
+++ b/misc/py-compressed-tensors/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1775500352
+SHA256 (compressed_tensors-0.14.0.1.tar.gz) = 5ad3841184b6f5020e06059b2463191c5c57a144bb97cab9159978d8118839b1
+SIZE (compressed_tensors-0.14.0.1.tar.gz) = 226393
diff --git a/misc/py-compressed-tensors/files/patch-pyproject.toml b/misc/py-compressed-tensors/files/patch-pyproject.toml
new file mode 100644
index 000000000000..0b6d748aa9fb
--- /dev/null
+++ b/misc/py-compressed-tensors/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
+--- pyproject.toml.orig 2026-04-06 19:59:22 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools", "wheel", "setuptools_scm==8.2.0"]
++requires = ["setuptools", "wheel", "setuptools_scm>=8.0"]
+ build-backend = "setuptools.build_meta"
+
+ [tool.black]
diff --git a/misc/py-compressed-tensors/files/patch-setup.py b/misc/py-compressed-tensors/files/patch-setup.py
new file mode 100644
index 000000000000..65030337c60c
--- /dev/null
+++ b/misc/py-compressed-tensors/files/patch-setup.py
@@ -0,0 +1,11 @@
+--- setup.py.orig 2026-04-06 20:05:23 UTC
++++ setup.py
+@@ -77,7 +77,7 @@ def _setup_install_requires() -> List:
+ )
+
+ def _setup_install_requires() -> List:
+- return ["torch>=1.7.0", "transformers<5.0.0", "pydantic>=2.0", "loguru"]
++ return ["torch>=1.7.0", "transformers>=4.0.0", "pydantic>=2.0", "loguru"]
+
+ def _setup_extras() -> Dict:
+ return {
diff --git a/misc/py-compressed-tensors/pkg-descr b/misc/py-compressed-tensors/pkg-descr
new file mode 100644
index 000000000000..7a9009b57190
--- /dev/null
+++ b/misc/py-compressed-tensors/pkg-descr
@@ -0,0 +1,3 @@
+compressed-tensors is a library for storing and loading compressed
+PyTorch models. It provides a unified format for various compression
+methods including quantization and sparsity.