Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/gpu/modal_score_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading