Summary
torchmetrics/functional/text/eed.py carries the RWTH Extended Edit Distance licence, which grants rights for non-commercial use only, while the package declares Apache-2.0. This looks like the same situation as #2665 (chrf.py, GPL-2.0), which was resolved in #2701 by obtaining relicensing approval from the original author — eed.py appears to have been missed in that pass.
As of 1.9.0 it is the only remaining file under torchmetrics/functional/text/ containing a non-commercial or GPL licence block.
The clause
From the licence block in eed.py (and identical to the original at rwth-i6/ExtendedEditDistance):
- You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license for non-commercial use only.
Clause 6 likewise limits linking to "a non-commercial setting". The licence states it is derived from the Q Public License v1.0 and the Qt Non-Commercial License v1.0.
torchmetrics/text/eed.py wraps that implementation in a Metric class and imports _eed_compute / _eed_update from it.
Why it is easy to miss
The package declares Apache-2.0, so every metadata-level check passes: PyPI classifiers, deps.dev, pip-audit, osv-scanner, and GitHub's own licence detection all report Apache-2.0. It only surfaces with a file-level scan — we found it with ScanCode Toolkit while preparing an Apache-2.0 release.
Reach
torchmetrics/__init__.py:37 does from torchmetrics import functional, and functional/__init__.py imports the text package eagerly, so import torchmetrics loads this module for every user — including those who only use, say, detection mAP. Anyone redistributing torchmetrics inside a build artifact is therefore redistributing this file.
Reproduce
pip download --no-deps torchmetrics==1.9.0
# unpack, then:
grep -n "non-commercial use only" torchmetrics/functional/text/eed.py
python -c "import torchmetrics, torchmetrics.functional.text.eed as m; print(m.__file__)"
Suggested direction
The remedy that worked for chrf.py seems the natural first thing to try: the RWTH authors may be willing to relicense the derived code, as Maja Popovic was. chrf.py now records that approval inline with a permalink, which is a nice pattern.
Failing that, the options are presumably the same ones weighed in #2665 — noting that the "it is an independent reimplementation" reading was explicitly rejected there.
Happy to open a PR for whichever direction you prefer, including a lazy-import or optional-extra arrangement if that is useful as an interim step.
Version
Checked against 1.9.0 (current release at time of writing).
Summary
torchmetrics/functional/text/eed.pycarries the RWTH Extended Edit Distance licence, which grants rights for non-commercial use only, while the package declares Apache-2.0. This looks like the same situation as #2665 (chrf.py, GPL-2.0), which was resolved in #2701 by obtaining relicensing approval from the original author —eed.pyappears to have been missed in that pass.As of 1.9.0 it is the only remaining file under
torchmetrics/functional/text/containing a non-commercial or GPL licence block.The clause
From the licence block in
eed.py(and identical to the original at rwth-i6/ExtendedEditDistance):Clause 6 likewise limits linking to "a non-commercial setting". The licence states it is derived from the Q Public License v1.0 and the Qt Non-Commercial License v1.0.
torchmetrics/text/eed.pywraps that implementation in aMetricclass and imports_eed_compute/_eed_updatefrom it.Why it is easy to miss
The package declares Apache-2.0, so every metadata-level check passes: PyPI classifiers, deps.dev,
pip-audit,osv-scanner, and GitHub's own licence detection all report Apache-2.0. It only surfaces with a file-level scan — we found it with ScanCode Toolkit while preparing an Apache-2.0 release.Reach
torchmetrics/__init__.py:37doesfrom torchmetrics import functional, andfunctional/__init__.pyimports the text package eagerly, soimport torchmetricsloads this module for every user — including those who only use, say, detection mAP. Anyone redistributing torchmetrics inside a build artifact is therefore redistributing this file.Reproduce
Suggested direction
The remedy that worked for
chrf.pyseems the natural first thing to try: the RWTH authors may be willing to relicense the derived code, as Maja Popovic was.chrf.pynow records that approval inline with a permalink, which is a nice pattern.Failing that, the options are presumably the same ones weighed in #2665 — noting that the "it is an independent reimplementation" reading was explicitly rejected there.
Happy to open a PR for whichever direction you prefer, including a lazy-import or optional-extra arrangement if that is useful as an interim step.
Version
Checked against 1.9.0 (current release at time of writing).