Skip to content

Commit

Permalink
refactor: more correct check not from PEP point of view
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPandir committed Feb 15, 2024
1 parent 880a201 commit ac681d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def __init__(self):

def generate(self, text: str, speaker: str, sample_rate: int) -> bytes:
model = self.model_by_speaker.get(speaker)
if model is None:
if not model:
raise NotFoundModelException(speaker)
if not sample_rate in self.VALID_SAMPLE_RATES:
if sample_rate not in self.VALID_SAMPLE_RATES:
raise InvalidSampleRateException(sample_rate)

return self._generate_audio(model, text, speaker, sample_rate)
Expand Down

0 comments on commit ac681d8

Please sign in to comment.