Print duplicate characters

This commit is contained in:
Eren Gölge 2021-11-24 18:42:00 +01:00
parent 3de9f38d16
commit 87bf940676
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ class BaseCharacters:
if self.is_unique:
assert (
len(self.vocab) == len(self._char_to_id) == len(self._id_to_char)
), f" [!] There are duplicate characters in the character set."
), f" [!] There are duplicate characters in the character set. {set([x for x in self.vocab if self.vocab.count(x) > 1])}"
def char_to_id(self, char: str) -> int:
return self._char_to_id[char]