Update tokenization_character_bert.py
Browse files
tokenization_character_bert.py
CHANGED
@@ -905,8 +905,8 @@ class CharacterMapper:
|
|
905 |
def convert_char_ids_to_word(self, char_ids: List[int]) -> str:
|
906 |
"Converts a sequence of character ids into its corresponding word."
|
907 |
|
908 |
-
assert len(char_ids)
|
909 |
-
f"Got character sequence of length {len(char_ids)} while
|
910 |
)
|
911 |
|
912 |
char_ids_ = [(i - 1) for i in char_ids]
|
|
|
905 |
def convert_char_ids_to_word(self, char_ids: List[int]) -> str:
|
906 |
"Converts a sequence of character ids into its corresponding word."
|
907 |
|
908 |
+
assert len(char_ids) <= self.max_word_length, (
|
909 |
+
f"Got character sequence of length {len(char_ids)} while `max_word_length={self.max_word_length}`"
|
910 |
)
|
911 |
|
912 |
char_ids_ = [(i - 1) for i in char_ids]
|