Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on out of range inputs depending on other inputs #1051

Open
colehaus opened this issue Sep 10, 2024 · 1 comment
Open

Crashes on out of range inputs depending on other inputs #1051

colehaus opened this issue Sep 10, 2024 · 1 comment
Labels

Comments

@colehaus
Copy link

Using sentencepiece 0.1.99 in python 3.11.10, an out of range may cause crashes depending on which other valid inputs are part of the batch:

>>> tkn.load(str(Path("gemma2-9b") / "tokenizer.model"))
True
>>> tkn.decode_ids([255000])
'\ue0a2'
>>> tkn.decode_ids([256000])
...
IndexError: Out of range: piece id is out of range.
>>> tkn.decode_ids([[1, 256000]])
...
IndexError: Out of range: piece id is out of range.
>>> tkn.decode_ids([[2, 4], [1, 256000]])
terminate called after throwing an instance of 'sentencepiece::util::Status'
Aborted (core dumped)

This easy to resolve once you know what the issue is. But that's not 100% obvious from the crash message and even that message is obscured if this error is initially encountered in a notebook where it crashes the Jupyter kernel.

@taku910
Copy link
Collaborator

taku910 commented Sep 22, 2024

Thank you for the report. The bug is reproduced.

@taku910 taku910 added the bug label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants