-
Notifications
You must be signed in to change notification settings - Fork 401
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
When consecutively entering the same text input, calling the RegexPrefixAllowedTokens instance results in an error at the second time. #1021
Comments
Could you please install the branch from this PR and check whether it resolves your issue? #966 |
Hi, I am also encountering this issue when on the main branch or on the suggested branch. I am able to trigger the error two ways:
Both cases occur due to the second query resulting in Here is the relevant code block: outlines/outlines/integrations/transformers.py Lines 104 to 121 in 26e2934
I propose changing the first conditional:
to recognize when a new but equal prompt has come in and reset the FSM state in that case. This appears to solve the problem, but I am not 100% sure on its correctness (relating to possible edge cases in particular). Thoughts? |
Describe the issue as clearly as possible:
For some reasons, I need to handle same the text input. I found that if I consecutively entering the same text input, I will break the assumption of
__call__
in RegexPrefixAllowedTokens:and get list index out of range error in
last_token = input_ids[-1]
Steps/code to reproduce the bug:
Expected result:
Error message:
Outlines/Python version information:
Version information
Context for the issue:
I think the assumption is not fully cover the usages, and may occur other unexpected errors.
The text was updated successfully, but these errors were encountered: