FIX silero_tts/elevenlabs_tts activation/deactivation (#2313)

This commit is contained in:
Gabriel Terrien 2023-05-24 15:06:38 +02:00 committed by GitHub
parent fc116711b0
commit e50ade438a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 19 deletions

View File

@ -62,22 +62,22 @@ def remove_surrounded_chars(string):
def state_modifier(state): def state_modifier(state):
if not params['activate']:
return state
state['stream'] = False state['stream'] = False
return state return state
def input_modifier(string): def input_modifier(string):
""" if not params['activate']:
This function is applied to your text inputs before return string
they are fed into the model.
"""
shared.processing_message = "*Is recording a voice message...*" shared.processing_message = "*Is recording a voice message...*"
return string return string
def history_modifier(history): def history_modifier(history):
# Remove autoplay from the last reply # Remove autoplay from the last reply
if len(history['internal']) > 0: if len(history['internal']) > 0:
history['visible'][-1] = [ history['visible'][-1] = [
@ -89,10 +89,6 @@ def history_modifier(history):
def output_modifier(string): def output_modifier(string):
"""
This function is applied to the model outputs.
"""
global params, wav_idx global params, wav_idx
if not params['activate']: if not params['activate']:

View File

@ -73,22 +73,22 @@ def toggle_text_in_history():
def state_modifier(state): def state_modifier(state):
if not params['activate']:
return state
state['stream'] = False state['stream'] = False
return state return state
def input_modifier(string): def input_modifier(string):
""" if not params['activate']:
This function is applied to your text inputs before return string
they are fed into the model.
"""
shared.processing_message = "*Is recording a voice message...*" shared.processing_message = "*Is recording a voice message...*"
return string return string
def history_modifier(history): def history_modifier(history):
# Remove autoplay from the last reply # Remove autoplay from the last reply
if len(history['internal']) > 0: if len(history['internal']) > 0:
history['visible'][-1] = [ history['visible'][-1] = [
@ -100,12 +100,7 @@ def history_modifier(history):
def output_modifier(string): def output_modifier(string):
"""
This function is applied to the model outputs.
"""
global model, current_params, streaming_state global model, current_params, streaming_state
for i in params: for i in params:
if params[i] != current_params[i]: if params[i] != current_params[i]:
model = load_model() model = load_model()