Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,14 @@ def synthesize_speech(text):
|
|
14 |
nsfw_result = nsfw_detector(text)
|
15 |
if nsfw_result[0]['label'] == 'NSFW':
|
16 |
# Path to your default error audio file
|
17 |
-
error_audio_path = hf_hub_download(repo_id="
|
18 |
with open(error_audio_path, 'rb') as error_audio_file:
|
19 |
error_audio = error_audio_file.read()
|
20 |
return error_audio, "NSFW content detected. Cannot process."
|
21 |
|
22 |
|
23 |
-
model_path = hf_hub_download(repo_id="
|
24 |
-
config_path = hf_hub_download(repo_id="
|
25 |
|
26 |
|
27 |
voice = PiperVoice.load(model_path, config_path)
|
|
|
14 |
nsfw_result = nsfw_detector(text)
|
15 |
if nsfw_result[0]['label'] == 'NSFW':
|
16 |
# Path to your default error audio file
|
17 |
+
error_audio_path = hf_hub_download(repo_id="DLI-SLQ/speaker_01234", filename= "error_audio.wav")
|
18 |
with open(error_audio_path, 'rb') as error_audio_file:
|
19 |
error_audio = error_audio_file.read()
|
20 |
return error_audio, "NSFW content detected. Cannot process."
|
21 |
|
22 |
|
23 |
+
model_path = hf_hub_download(repo_id="DLI-SLQ/speaker_01234", filename="speaker__01234_model.onnx")
|
24 |
+
config_path = hf_hub_download(repo_id="DLI-SLQ/speaker_01234", filename="speaker__-1234_model.onnx.json")
|
25 |
|
26 |
|
27 |
voice = PiperVoice.load(model_path, config_path)
|