Skip to content

Commit 63f31c2

Browse files
committed
🔧 Fix pytest.
1 parent 87f67d2 commit 63f31c2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

tensorflow_tts/processor/base_processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def __post_init__(self):
6464

6565
# processor name. usefull to use it for AutoProcessor
6666
self._processor_name = type(self).__name__
67-
self.eos_id = self.symbol_to_id[self.setup_eos_token()]
67+
68+
if self.setup_eos_token():
69+
self.eos_id = self.symbol_to_id[self.setup_eos_token()]
6870

6971
def __getattr__(self, name: str) -> Union[str, int]:
7072
if "_id" in name: # map symbol to id

tensorflow_tts/processor/libritts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_one_sample(self, item):
8484
return sample
8585

8686
def setup_eos_token(self):
87-
return None
87+
return None # because we do not use this
8888

8989
def text_to_sequence(self, text):
9090
if (

test/test_base_processor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def get_one_sample(self, item):
2121
def text_to_sequence(self, text):
2222
return ["0"]
2323

24+
def setup_eos_token(self):
25+
return None
26+
2427

2528
@pytest.fixture
2629
def processor(tmpdir):

0 commit comments

Comments
 (0)