Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import re
|
|
10 |
app = Flask(__name__)
|
11 |
|
12 |
# Define the folder where files are saved
|
13 |
-
file_folder = '/app/'
|
14 |
|
15 |
def filter_text(text):
|
16 |
filtered_text = re.sub(r'[^\w\s,.\(\):\u00C0-\u00FF]', '', text)
|
@@ -23,7 +23,7 @@ def convert_text_to_speech(parrafo, model):
|
|
23 |
random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
|
24 |
output_file = os.path.join(file_folder, random_name)
|
25 |
app.logger.info("Audio file created at: %s", output_file)
|
26 |
-
piper_exe = os.path.join(file_folder, 'piper')
|
27 |
|
28 |
if os.path.isfile(piper_exe):
|
29 |
comando = f'echo {parrafo_filtrado} | "{piper_exe}" -m {model} -f {output_file}'
|
|
|
10 |
app = Flask(__name__)
|
11 |
|
12 |
# Define the folder where files are saved
|
13 |
+
file_folder = '/home/app/'
|
14 |
|
15 |
def filter_text(text):
|
16 |
filtered_text = re.sub(r'[^\w\s,.\(\):\u00C0-\u00FF]', '', text)
|
|
|
23 |
random_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8)) + '.wav'
|
24 |
output_file = os.path.join(file_folder, random_name)
|
25 |
app.logger.info("Audio file created at: %s", output_file)
|
26 |
+
piper_exe = os.path.join(file_folder, 'home', 'app', 'piper')
|
27 |
|
28 |
if os.path.isfile(piper_exe):
|
29 |
comando = f'echo {parrafo_filtrado} | "{piper_exe}" -m {model} -f {output_file}'
|