-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
stop_strings
Argument in model.generate()
Results in Exception if Generation Completes Without stop_string
Being Generated
#31435
Comments
stop_strings
Argument in model.generate()
Results in Exceptionstop_strings
Argument in model.generate()
Results in Exception if Generation Completes Without stop_string
Being Generated
Might be a duplicate of #31435 |
It looks like this line sets the @ahmed-moubtahij could you please take a look? Popping |
Seems that the bug appears only when the stop string is a single letter, because in that case it's impossible to get And the tokenizer-related issue is a bug, will be fixed soon! |
On it! |
Fix is open here |
@lapp0 Thanks for the headsup! I just forked to remove it but @gante outsped me :) Not sure how critical, but the "we only use it for stopping criteria" comment doesn't stand anymore |
System Info
transformers==4.41.2
Who can help?
@gante any thoughts here?
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I'm also having issues with the new
generate()
changes when using anystop_strings
argument.Minimal reproducer:
Generation with no
stop_strings
worksGeneration with unseen
stop_strings
failsGeneration with seen
stop_strings
worksDesired behavior is that even if
stop_strings
isn't seen by the end of the sequence it generates successfully.It may have been introduced in 0d84901
Expected behavior
model.generate(stop_string=...)
is successful even ifstop_string
isn't encountered.ValueError: max() arg is an empty sequence
doesn't occur.The text was updated successfully, but these errors were encountered: