Spaces:
Running
Running
Update app.py
Browse files
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(
|
56 |
app.logger.info("Audio file created at: %s", output_file)
|
57 |
-
piper_exe = os.path.join(
|
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(
|
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'])
|