Skip to content

Commit adafbff

Browse files
committed
🔧 Fix keyError: 'pinyin_parser'.
1 parent 005c1a4 commit adafbff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tensorflow_tts/processor/baker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ class BakerProcessor(BaseProcessor):
545545
target_rate: int = 24000
546546
speaker_name: str = "baker"
547547

548+
def __post_init__(self):
549+
super().__post_init__()
550+
self.pinyin_parser = self.get_pinyin_parser()
551+
548552
def create_items(self):
549553
items = []
550554
if self.data_dir:
@@ -565,7 +569,6 @@ def create_items(self):
565569
[" ".join(phonemes), wav_path, utt_id, self.speaker_name]
566570
)
567571
self.items = items
568-
self.pinyin_parser = self.get_pinyin_parser()
569572

570573
def get_phoneme_from_char_and_pinyin(self, chn_char, pinyin):
571574
# we do not need #4, use sil to replace it

0 commit comments

Comments
 (0)