HirCoir commited on
Commit
c30e625
1 Parent(s): ec64c3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -52,9 +52,9 @@ def convert_text_to_speech(text, model_name):
52
  return None
53
 
54
  random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
55
- output_file = os.path.join(file_folder, random_name)
56
  app.logger.info("Audio file created at: %s", output_file)
57
- piper_exe = os.path.join(file_folder, 'piper') # Adjusted the path for piper
58
 
59
  if os.path.isfile(piper_exe):
60
  comando = f'echo {filtered_text} | "{piper_exe}" -m {model_name} -f {output_file}'
@@ -66,10 +66,9 @@ def convert_text_to_speech(text, model_name):
66
 
67
  @app.route('/')
68
  def index():
69
- model_folder = file_folder # Adjusted the model folder to file_folder
70
  model_options = [file for file in os.listdir(model_folder) if file.endswith('.onnx')]
71
  # Log the contents of the current folder
72
- app.logger.info("Contents of current folder: %s", os.listdir(file_folder))
73
  return render_template('index.html', model_options=model_options)
74
 
75
  @app.route('/convert', methods=['POST'])
 
52
  return None
53
 
54
  random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
55
+ output_file = os.path.join(model_folder, random_name)
56
  app.logger.info("Audio file created at: %s", output_file)
57
+ piper_exe = os.path.join(model_folder, 'piper') # Adjusted the path for piper
58
 
59
  if os.path.isfile(piper_exe):
60
  comando = f'echo {filtered_text} | "{piper_exe}" -m {model_name} -f {output_file}'
 
66
 
67
  @app.route('/')
68
  def index():
 
69
  model_options = [file for file in os.listdir(model_folder) if file.endswith('.onnx')]
70
  # Log the contents of the current folder
71
+ app.logger.info("Contents of current folder: %s", os.listdir(model_folder))
72
  return render_template('index.html', model_options=model_options)
73
 
74
  @app.route('/convert', methods=['POST'])