Skip to content

Commit

Permalink
Update src/transformers/generation/stopping_criteria.py
Browse files Browse the repository at this point in the history
Co-authored-by: Joao Gante <[email protected]>
  • Loading branch information
Rocketknight1 and gante authored Feb 15, 2024
1 parent 4e0a8ae commit 06941de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/generation/stopping_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def get_matching_positions(vocab: List[str], stop_strings: List[str]) -> Tuple[D
strings_to_end_lengths[stop_string][token] = possible_end_lengths
return strings_to_valid_positions, strings_to_end_lengths

def create_embedding_vecs(self):
def create_embedding_vecs(self) -> Dict[str, torch.tensor]:
"""
This function builds an embedding matrix for each stop string, consisting of possible valid positions
and possible end lengths for each token, and the total length of the token string. When tokens have
Expand Down

0 comments on commit 06941de

Please sign in to comment.