nakas commited on
Commit
c5924a1
1 Parent(s): 42f30a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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=".mp3", 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(file.name)
123
  file_cleaner.add(file.name)
124
- res = [out_file.result() 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)
 
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)