mirror of https://github.com/coqui-ai/TTS.git
Print duplicate characters
This commit is contained in:
parent
3de9f38d16
commit
87bf940676
|
@ -206,7 +206,7 @@ class BaseCharacters:
|
||||||
if self.is_unique:
|
if self.is_unique:
|
||||||
assert (
|
assert (
|
||||||
len(self.vocab) == len(self._char_to_id) == len(self._id_to_char)
|
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:
|
def char_to_id(self, char: str) -> int:
|
||||||
return self._char_to_id[char]
|
return self._char_to_id[char]
|
||||||
|
|
Loading…
Reference in New Issue