Sfoglia il codice sorgente

Make it possible to disable the TTS from within the interface

oobabooga 3 anni fa
parent
commit
cb226247e8
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      extensions/silero_tts/script.py

+ 4 - 0
extensions/silero_tts/script.py

@@ -6,6 +6,7 @@ import torch
 torch._C._jit_set_profiling_mode(False)
 
 params = {
+    'activate': True,
     'speaker': 'en_56',
     'language': 'en',
     'model_id': 'v3_en',
@@ -52,6 +53,9 @@ def output_modifier(string):
             current_params = params.copy()
             break
 
+    if params['activate'] == False:
+        return string
+
     string = remove_surrounded_chars(string)
     string = string.replace('"', '')
     string = string.replace('“', '')