Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Commit
•
8450c00
1
Parent(s):
7924f09
Update app.py
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ E2TTS_ema_model, E2TTS_base_model = load_model("E2TTS_Base", UNetT, E2TTS_model_
|
|
85 |
@spaces.GPU
|
86 |
def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, progress = gr.Progress()):
|
87 |
print(gen_text)
|
88 |
-
if model.predict(
|
89 |
print("Flagged for toxicity:", gen_text)
|
90 |
raise gr.Error("Your text was flagged for toxicity, please try again with a different text.")
|
91 |
gr.Info("Converting audio...")
|
|
|
85 |
@spaces.GPU
|
86 |
def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, progress = gr.Progress()):
|
87 |
print(gen_text)
|
88 |
+
if model.predict(gen_text)['toxicity'] > 0.8:
|
89 |
print("Flagged for toxicity:", gen_text)
|
90 |
raise gr.Error("Your text was flagged for toxicity, please try again with a different text.")
|
91 |
gr.Info("Converting audio...")
|