Fix silero tts autoplay (attempt #2)

This commit is contained in:
oobabooga 2023-05-21 13:24:54 -03:00
parent a5d5bb9390
commit 1e5821bd9e
4 changed files with 25 additions and 9 deletions

View file

@ -83,17 +83,22 @@ def input_modifier(string):
they are fed into the model.
"""
# Remove autoplay from the last reply
if shared.is_chat() and len(shared.history['internal']) > 0:
shared.history['visible'][-1] = [
shared.history['visible'][-1][0],
shared.history['visible'][-1][1].replace('controls autoplay>', 'controls>')
]
shared.processing_message = "*Is recording a voice message...*"
return string
def history_modifier(history):
# Remove autoplay from the last reply
if len(history['internal']) > 0:
history['visible'][-1] = [
history['visible'][-1][0],
history['visible'][-1][1].replace('controls autoplay>', 'controls>')
]
return history
def output_modifier(string):
"""
This function is applied to the model outputs.