HirCoir commited on
Commit
05786ca
1 Parent(s): 168ae7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -19,6 +19,9 @@ def filter_text(text):
19
  return filtered_text
20
 
21
  def convert_text_to_speech(parrafo, model):
 
 
 
22
  parrafo_filtrado = filter_text(parrafo)
23
  random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
24
  output_file = os.path.join(file_folder, random_name)
@@ -32,6 +35,7 @@ def convert_text_to_speech(parrafo, model):
32
  else:
33
  return "The piper.exe file was not found in the correct directory."
34
 
 
35
  @app.route('/')
36
  def index():
37
  model_folder = file_folder # Adjusted the model folder to file_folder
 
19
  return filtered_text
20
 
21
  def convert_text_to_speech(parrafo, model):
22
+ # Limit text to 500 characters
23
+ parrafo = parrafo[:500]
24
+
25
  parrafo_filtrado = filter_text(parrafo)
26
  random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
27
  output_file = os.path.join(file_folder, random_name)
 
35
  else:
36
  return "The piper.exe file was not found in the correct directory."
37
 
38
+
39
  @app.route('/')
40
  def index():
41
  model_folder = file_folder # Adjusted the model folder to file_folder