From 836cedce3351125901d72bdbc45876f1d845a6c9 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sat, 5 Sep 2026 15:38:54 +0200 Subject: [PATCH] fix(artifact-score): generation cap in tokens, not characters The torch harness caps decode at 2x the window's token count; a byte-level window's tokens equal its UTF-8 byte count. The character-count cap truncated every long paragraph's vocalized tail (30.54 DER artifact-faithfully scoring truncated output). --- src/gpu/modal_score_artifact.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gpu/modal_score_artifact.py b/src/gpu/modal_score_artifact.py index 7e0f333..bca9ff7 100644 --- a/src/gpu/modal_score_artifact.py +++ b/src/gpu/modal_score_artifact.py @@ -83,7 +83,11 @@ def score(zip_path: str, expect_sha: str = "", out: str = "") -> dict: stripped = strip_diacritics(src) pieces = [] for w in split_windows(stripped, 1400): - out_text = model.translate(w, max_len=max(256, 2 * len(w))) + # the torch harness caps generation at 2x the window's + # TOKEN count; a byte-level window's tokens = its UTF-8 + # byte count, and vocalized output needs ~2x that — a + # character-count cap truncates every long paragraph + out_text = model.translate(w, max_len=max(256, 2 * len(w.encode("utf-8")))) pieces.append(project_haraqat(out_text, w)) preds.append("".join(pieces)) if (i + 1) % 100 == 0: