-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
Description
System Info
according to the implementations of the Constraint ABC, the advance() function can return either a single token id (as the docstring indicates) or a list of token ids that would advance the beam search. It should be updated to reflect this.
Here is an example fix:
@abstractmethod
def advance(self):
"""
When called, returns the token(s) that would take this constraint one step closer to being fulfilled.
Return:
token_ids (Union[int, List[int], None]):
- A single token ID (int) that advances the constraint
- A list of token IDs that could advance the constraint
- None if the constraint is completed or cannot be advanced
"""
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
Just a docstring change.
Expected behavior
Should be updated for accuracy, easy of implementing this abstract base class.
Reactions are currently unavailable