Update _utils.py
This commit is contained in:
parent
d818697900
commit
6f19b9aecd
1 changed files with 1 additions and 1 deletions
|
|
@ -507,7 +507,7 @@ def patch_tokenizer(model, tokenizer):
|
|||
"\u00BF", # Inverted question mark
|
||||
]
|
||||
for replacement_char in possible_replacements:
|
||||
char = tokenizer(replacement_char, add_special_tokens = False)
|
||||
char = tokenizer(replacement_char, add_special_tokens = False).input_ids
|
||||
if len(char) == 1:
|
||||
# Get actual token representation
|
||||
try: char = tokenizer.convert_ids_to_tokens(char[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue