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
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
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):
if not params['activate']:
return state
state['stream'] = False
return state
def input_modifier(string):
"""
This function is applied to your text inputs before
they are fed into the model.
"""
if not params['activate']:
return string
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] = [
@ -89,10 +89,6 @@ def history_modifier(history):
def output_modifier(string):
"""
This function is applied to the model outputs.
"""
global params, wav_idx
if not params['activate']:

View file

@ -73,22 +73,22 @@ def toggle_text_in_history():
def state_modifier(state):
if not params['activate']:
return state
state['stream'] = False
return state
def input_modifier(string):
"""
This function is applied to your text inputs before
they are fed into the model.
"""
if not params['activate']:
return string
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] = [
@ -100,12 +100,7 @@ def history_modifier(history):
def output_modifier(string):
"""
This function is applied to the model outputs.
"""
global model, current_params, streaming_state
for i in params:
if params[i] != current_params[i]:
model = load_model()