Print duplicate characters

This commit is contained in:
Eren Gölge
2022-02-25 10:48:03 +01:00
parent 3de9f38d16
commit 87bf940676
+1 -1
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]