python-utmos-pytorch

LOW
maintainer Smoolak 0 votes scanned 2026-11-01 20:01:18.389276
View on AUR
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>
2pkgname=python-utmos-pytorch
3pkgver=0.1.0
4pkgrel=1
5pkgdesc='Fairseq-free PyTorch implementation of UTMOS speech quality prediction'
6arch=(any)
7url='https://github.com/Blinorot/utmos-pytorch'
8license=(MIT)
9depends=(python 'python-pytorch>=2.2.0' 'python-huggingface-hub>=0.20')
10makedepends=(python-build python-installer 'python-setuptools>=69' python-wheel)
11_commit=fad24d9b173153353c8e276b5b6780c8a9e319b8
12source=("utmos-pytorch-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
13sha256sums=('4a4b586ab77907639473257a0148b9377765682a2bf9a0b4e53f2f6e9d890faf')
14
15prepare() {
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
21build() {
22 cd "utmos-pytorch-$_commit"
23 python -m build --wheel --no-isolation
24}
25
26check() {
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'
34import ast
35from pathlib import Path
36import torch
37from torch.nn.utils.rnn import pad_sequence
38from utmos_pytorch.utmos_torch import UTMOSModel
39
40source = ast.parse(Path("test.py").read_text())
41collate = next(node for node in source.body
42 if isinstance(node, ast.FunctionDef) and node.name == "collate_fn")
43namespace = {"pad_sequence": pad_sequence}
44exec(compile(ast.Module(body=[collate], type_ignores=[]), "test.py", "exec"), namespace)
45batch = namespace["collate_fn"]([torch.zeros(1, 16000), torch.zeros(1, 12000)])
46assert batch.shape == (2, 1, 16000)
47torch.set_num_threads(2)
48model = UTMOSModel().eval()
49with torch.inference_mode():
50 scores = model(batch, torch.zeros(2, dtype=torch.int),
51 torch.full((2,), 288, dtype=torch.int))
52assert scores.ndim == 3 and scores.shape[0] == 2 and scores.shape[-1] == 1
53assert scores.shape[1] > 0 and torch.isfinite(scores).all()
54print("Upstream collation and built-wheel model forward path: PASS")
55PYTEST
56}
57
58package() {
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)SeverityRules
2026-11-01 20:01:18 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion