🎨 Run linter

This commit is contained in:
2024-04-21 21:39:39 +02:00
parent 4cb395d279
commit 0fc86d2661
12 changed files with 77 additions and 56 deletions

View File

@@ -103,7 +103,9 @@ class CoquiTTSEngine(BaseTTSEngine):
try:
self.tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
except:
raise Exception("An error occured when loading thr TTS model. Make sure that you have agreed to the TOS in the TTSEngine tab.")
raise Exception(
"An error occured when loading thr TTS model. Make sure that you have agreed to the TOS in the TTSEngine tab."
)
device = "cuda" if torch.cuda.is_available() else "cpu"
self.tts.to(device)
@@ -124,9 +126,7 @@ class CoquiTTSEngine(BaseTTSEngine):
if self.to_force_duration:
self.force_duration(float(self.duration), path)
self.ctx.duration = self.get_audio_duration(path)
self.ctx.timed_script = self.time_with_whisper(path)
return self.get_audio_duration(path)
@classmethod
def get_options(cls) -> list:
@@ -162,10 +162,12 @@ class CoquiTTSEngine(BaseTTSEngine):
options.append(duration_checkbox)
options.append(duration)
options.append(gr.Checkbox(
label="I agree to the Coqui public mode license",
info="You must agree to the Coqui TTS terms of service to use this engine: https://coqui.ai/cpml",
value=False,
show_label=True,
))
options.append(
gr.Checkbox(
label="I agree to the Coqui public mode license",
info="You must agree to the Coqui TTS terms of service to use this engine: https://coqui.ai/cpml",
value=False,
show_label=True,
)
)
return options