diff --git a/tts.py b/tts.py index f7f16cd..bce40ec 100644 --- a/tts.py +++ b/tts.py @@ -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)