Unescape model output for silero/elevenlabs

This commit is contained in:
oobabooga 2023-08-24 17:27:12 -07:00
parent 3320accfdc
commit a2c67262c7
2 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import html
import random
import time
from pathlib import Path
@ -125,7 +126,7 @@ def output_modifier(string, state):
else:
output_file = Path(f'extensions/silero_tts/outputs/{state["character_menu"]}_{int(time.time())}.wav')
prosody = '<prosody rate="{}" pitch="{}">'.format(params['voice_speed'], params['voice_pitch'])
silero_input = f'<speak>{prosody}{xmlesc(string)}</prosody></speak>'
silero_input = f'<speak>{prosody}{xmlesc(html.unescape(string))}</prosody></speak>'
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 ''