mirror of https://github.com/coqui-ai/TTS.git
Fixup
This commit is contained in:
parent
659bce0d6c
commit
af16348cfb
|
@ -63,6 +63,18 @@ class BaseVocabulary:
|
|||
the vocabulary."""
|
||||
return self.char_to_id(self.blank) if self.blank else len(self.vocab)
|
||||
|
||||
@property
|
||||
def bos_id(self) -> int:
|
||||
"""Return the index of the bos character. If the bos character is not specified, return the length of the
|
||||
vocabulary."""
|
||||
return self.char_to_id(self.bos) if self.bos else len(self.vocab)
|
||||
|
||||
@property
|
||||
def eos_id(self) -> int:
|
||||
"""Return the index of the eos character. If the eos character is not specified, return the length of the
|
||||
vocabulary."""
|
||||
return self.char_to_id(self.eos) if self.eos else len(self.vocab)
|
||||
|
||||
@property
|
||||
def vocab(self):
|
||||
"""Return the vocabulary dictionary."""
|
||||
|
@ -187,6 +199,14 @@ class BaseCharacters:
|
|||
def blank_id(self) -> int:
|
||||
return self.char_to_id(self.blank) if self.blank else len(self.vocab)
|
||||
|
||||
@property
|
||||
def eos_id(self) -> int:
|
||||
return self.char_to_id(self.eos) if self.eos else len(self.vocab)
|
||||
|
||||
@property
|
||||
def bos_id(self) -> int:
|
||||
return self.char_to_id(self.bos) if self.bos else len(self.vocab)
|
||||
|
||||
@property
|
||||
def characters(self):
|
||||
return self._characters
|
||||
|
|
Loading…
Reference in New Issue