lir: a word of 1,667 letters or more raises a raw onnxruntime error

Open Beginner friendly
#394 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read scriptconv/phonemizers/lir.py around lines 119-120, where ids is built by repeating each character char_repeats times and handed to self.session.run. First run the reproduction snippet in the issue to see the raw onnxruntime Fail, then check char_repeats and the model's 5,000-id input bound to confirm the 1,666-letter cutoff. Done means an over-long word raises a scriptconv error that names the limit (or is split into readable parts) instead of leaking the onnxruntime class, plus a test alongside the existing phonemizer tests.

Written by the indexing model from the issue text.

Description

🤖 Auto-generated by Claude Opus 5.5 (claude-opus-5-5) via Claude Code — NOT human-reviewed. Verify before acting.

Verified against source: the outputs below come from a run on scriptconv origin/dev 03b4c08 with the lir extra and the pinned model files.

Observed

The Kolokwa backend (KolokwaPhonemizer, language lir) raises a raw onnxruntime error for a word of 1,667 letters or more. A word of 1,666 letters gives phonemes.

Word length Result
1,000 phonemes (227 characters)
1,666 phonemes (300 characters)
1,667 onnxruntime.capi.onnxruntime_pybind11_state.Fail: Non-zero status code returned while running Gather node. Name:'node_embedding' ... Shape mismatch attempting to re-use buffer. {5000,1,512} != {6002,1,512}
2,000 the same Fail

The review of #376 found the same failure in the upstream kolokwa-g2p code. This run did not check upstream. The error type is an onnxruntime class, so a caller cannot catch it as a scriptconv error.

Expected

A word that is longer than the model input gives a scriptconv error that names the limit, or the backend cuts the word into parts that the model reads. The model reads at most 5,000 ids. Each letter gives three ids (char_repeats is 3) and the bounds give two, so the limit is 1,666 letters, and the backend can check it before the call.

Reproduce

from scriptconv.phonemizers.lir import KolokwaPhonemizer

p = KolokwaPhonemizer()
p.phonemize_string("ba" * 833 + "b", "lir")

Where

scriptconv/phonemizers/lir.py: lines 119 and 120 build ids from each letter repeated char_repeats times and pass them to self.session.run with no length check.

Dominant language
Python
Stars
4
Forks
1
Avg merge
8h 57m
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TigreGotico/scriptconv

All issues in TigreGotico/scriptconv

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.