diff --git a/src/transformers/generation/stopping_criteria.py b/src/transformers/generation/stopping_criteria.py index 56b8466830b52d..73418d388073fd 100644 --- a/src/transformers/generation/stopping_criteria.py +++ b/src/transformers/generation/stopping_criteria.py @@ -178,7 +178,7 @@ def get_matching_positions(vocab, stop_strings): matching_positions = [] possible_end_lengths = [] for i in range(1 - len(token), len(stop_string)): - tok = token[::-1].replace("▁", " ") + tok = token[::-1].replace("▁", " ").replace("Ġ", " ") stop = stop_string[::-1] if i < 0: tok = tok[-i:]