fix: correct stop_sequence -> stop_sequences typo in _continuous_greedy_until#1300
Open
RudrenduPaul wants to merge 1 commit into
Open
fix: correct stop_sequence -> stop_sequences typo in _continuous_greedy_until#1300RudrenduPaul wants to merge 1 commit into
RudrenduPaul wants to merge 1 commit into
Conversation
The Doc/request object exposes stop_sequences (plural), so split[0].stop_sequence raised an AttributeError when continuous batching generation tried to read stop tokens. Fixes huggingface#888
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #888
What this PR does
Fixes a typo in
TransformersModel._continuous_greedy_untilwhere the coderead
split[0].stop_sequence(singular) instead ofsplit[0].stop_sequences(plural). The
Doc/request object only defines astop_sequencesfield(
src/lighteval/tasks/requests.py), so the singular access either raises anAttributeErroror silently returnsNonedepending on the object type,breaking stop-sequence handling for continuous batching generation.
Root cause
src/lighteval/models/transformers/transformers_model.py, inside_continuous_greedy_until, buildsstop_tokensfrom the first item in thebatch:
The correct attribute name (
stop_sequences) is already used consistentlyelsewhere in the same file (e.g.
_generateusesbatch[0].stop_sequences), confirming this was a one-off typo rather thanan intentional different field.
Change
Single-line fix in
src/lighteval/models/transformers/transformers_model.py(line 561). No other file references the typo'd singular form, so this is
the only place that needed updating.
Verification
stop_sequences(plural) is the actual field defined on therequest/
Docobject insrc/lighteval/tasks/requests.py.grepthat no other code path intransformers_model.pyreferences the singular.stop_sequencetypo.ruff format --checkandruff checkboth pass on the changed file.