Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -115,13 +115,13 @@ def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
|
115 |
outputs = outputs.detach().cpu().float()
|
116 |
out_files = []
|
117 |
for output in outputs:
|
118 |
-
with NamedTemporaryFile("wb", suffix=".
|
119 |
audio_write(
|
120 |
file.name, output, MODEL.sample_rate, strategy="loudness",
|
121 |
loudness_headroom_db=16, loudness_compressor=True, add_suffix=False)
|
122 |
-
out_files.append(file.name)
|
123 |
file_cleaner.add(file.name)
|
124 |
-
res = [out_file
|
125 |
for file in res:
|
126 |
file_cleaner.add(file)
|
127 |
print("batch finished", len(texts), time.time() - be)
|
|
|
115 |
outputs = outputs.detach().cpu().float()
|
116 |
out_files = []
|
117 |
for output in outputs:
|
118 |
+
with NamedTemporaryFile("wb", suffix=".wav", delete=False) as file:
|
119 |
audio_write(
|
120 |
file.name, output, MODEL.sample_rate, strategy="loudness",
|
121 |
loudness_headroom_db=16, loudness_compressor=True, add_suffix=False)
|
122 |
+
out_files.append(pool.submit(make_waveform, file.name))
|
123 |
file_cleaner.add(file.name)
|
124 |
+
res = [out_file for out_file in out_files]
|
125 |
for file in res:
|
126 |
file_cleaner.add(file)
|
127 |
print("batch finished", len(texts), time.time() - be)
|