python-utmos-pytorch
LOW
maintainer Smoolak
0 votes
scanned 2026-11-01 20:01:18.389276
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Smoolak <smoolak@gmail.com>
2
pkgname=python-utmos-pytorch
3
pkgver=0.1.0
4
pkgrel=1
5
pkgdesc='Fairseq-free PyTorch implementation of UTMOS speech quality prediction'
6
arch=(any)
7
url='https://github.com/Blinorot/utmos-pytorch'
8
license=(MIT)
9
depends=(python 'python-pytorch>=2.2.0' 'python-huggingface-hub>=0.20')
10
makedepends=(python-build python-installer 'python-setuptools>=69' python-wheel)
11
_commit=fad24d9b173153353c8e276b5b6780c8a9e319b8
12
source=("utmos-pytorch-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
13
sha256sums=('4a4b586ab77907639473257a0148b9377765682a2bf9a0b4e53f2f6e9d890faf')
14
15
prepare() {
16
cd "utmos-pytorch-$_commit"
17
# Upstream data-files otherwise puts third-party notices in /usr/LICENSES.
18
sed -i 's/^"LICENSES" = /"share\/licenses\/python-utmos-pytorch" = /' pyproject.toml
19
}
20
21
build() {
22
cd "utmos-pytorch-$_commit"
23
python -m build --wheel --no-isolation
24
}
25
26
check() {
27
cd "utmos-pytorch-$_commit"
28
# The legacy three-way test needs fairseq, original checkpoints and LibriSpeech.
29
# Run its offline collation helper and the packaged model's forward path here.
30
# Pretrained Torch/TorchScript speech scoring is validated after installation.
31
python -m installer --destdir="$srcdir/check" dist/*.whl
32
local site_packages=("$srcdir"/check/usr/lib/python*/site-packages)
33
PYTHONPATH="${site_packages[0]}" python - <<'PYTEST'
34
import ast
35
from pathlib import Path
36
import torch
37
from torch.nn.utils.rnn import pad_sequence
38
from utmos_pytorch.utmos_torch import UTMOSModel
39
40
source = ast.parse(Path("test.py").read_text())
41
collate = next(node for node in source.body
42
if isinstance(node, ast.FunctionDef) and node.name == "collate_fn")
43
namespace = {"pad_sequence": pad_sequence}
44
exec(compile(ast.Module(body=[collate], type_ignores=[]), "test.py", "exec"), namespace)
45
batch = namespace["collate_fn"]([torch.zeros(1, 16000), torch.zeros(1, 12000)])
46
assert batch.shape == (2, 1, 16000)
47
torch.set_num_threads(2)
48
model = UTMOSModel().eval()
49
with torch.inference_mode():
50
scores = model(batch, torch.zeros(2, dtype=torch.int),
51
torch.full((2,), 288, dtype=torch.int))
52
assert scores.ndim == 3 and scores.shape[0] == 2 and scores.shape[-1] == 1
53
assert scores.shape[1] > 0 and torch.isfinite(scores).all()
54
print("Upstream collation and built-wheel model forward path: PASS")
55
PYTEST
56
}
57
58
package() {
59
cd "utmos-pytorch-$_commit"
60
python -m installer --destdir="$pkgdir" dist/*.whl
61
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
62
}
63
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-01 20:01:18 | Low | 1 |