Skip to content

Commit 3f33606

Browse files
committed
✍ Add eos token to the symbol list in case it's not in the list.
1 parent 63f31c2 commit 3f33606

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tensorflow_tts/processor/base_processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ def __post_init__(self):
6161
self.create_symbols()
6262
if self.saved_mapper_path is not None:
6363
self._save_mapper(saved_path=self.saved_mapper_path)
64-
64+
6565
# processor name. usefull to use it for AutoProcessor
6666
self._processor_name = type(self).__name__
6767

6868
if self.setup_eos_token():
69+
self.add_symbol(
70+
self.setup_eos_token()
71+
) # if this eos token not yet present in symbols list.
6972
self.eos_id = self.symbol_to_id[self.setup_eos_token()]
7073

7174
def __getattr__(self, name: str) -> Union[str, int]:
@@ -159,7 +162,6 @@ def setup_eos_token(self):
159162
"""Return eos symbol of type string."""
160163
return "eos"
161164

162-
163165
def convert_symbols_to_ids(self, symbols: Union[str, list]):
164166
sequence = []
165167
if isinstance(symbols, str):

0 commit comments

Comments
 (0)