From 1a642c12b582330a4780047461905787cc3f18c5 Mon Sep 17 00:00:00 2001
From: oobabooga <112222186+oobabooga@users.noreply.github.com>
Date: Sat, 26 Aug 2023 00:45:07 -0700
Subject: [PATCH] Fix silero_tts HTML unescaping
---
extensions/silero_tts/script.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/extensions/silero_tts/script.py b/extensions/silero_tts/script.py
index e7616918..31677eca 100644
--- a/extensions/silero_tts/script.py
+++ b/extensions/silero_tts/script.py
@@ -119,14 +119,14 @@ def output_modifier(string, state):
return string
original_string = string
- string = tts_preprocessor.preprocess(string)
+ string = tts_preprocessor.preprocess(html.unescape(string))
if string == '':
string = '*Empty reply, try regenerating*'
else:
output_file = Path(f'extensions/silero_tts/outputs/{state["character_menu"]}_{int(time.time())}.wav')
prosody = ''.format(params['voice_speed'], params['voice_pitch'])
- silero_input = f'{prosody}{xmlesc(html.unescape(string))}'
+ silero_input = f'{prosody}{xmlesc(string)}'
model.save_wav(ssml_text=silero_input, speaker=params['speaker'], sample_rate=int(params['sample_rate']), audio_path=str(output_file))
autoplay = 'autoplay' if params['autoplay'] else ''