AndreasXi commited on
Commit
22e35a0
·
1 Parent(s): 629a90b
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -164,17 +164,17 @@ def generate_audio_gradio(
164
 
165
  audio = fade_out(audio, seq_cfg.sampling_rate)
166
 
167
- safe_prompt = (
168
- "".join(c for c in prompt if c.isalnum() or c in (" ", "_"))
169
- .rstrip()
170
- .replace(" ", "_")[:50]
171
- )
172
- current_time_string = datetime.now().strftime("%Y%m%d_%H%M%S_%f")
173
- filename = f"{safe_prompt}_{current_time_string}_{i}.flac"
174
- save_path = OUTPUT_DIR / filename
175
- torchaudio.save(str(save_path), audio, seq_cfg.sampling_rate)
176
- log.info(f"Audio saved to {save_path}")
177
- save_paths.append(str(save_path))
178
  if device == "cuda":
179
  torch.cuda.empty_cache()
180
 
 
164
 
165
  audio = fade_out(audio, seq_cfg.sampling_rate)
166
 
167
+ safe_prompt = (
168
+ "".join(c for c in prompt if c.isalnum() or c in (" ", "_"))
169
+ .rstrip()
170
+ .replace(" ", "_")[:50]
171
+ )
172
+ current_time_string = datetime.now().strftime("%Y%m%d_%H%M%S_%f")
173
+ filename = f"{safe_prompt}_{current_time_string}_{i}.flac"
174
+ save_path = OUTPUT_DIR / filename
175
+ torchaudio.save(str(save_path), audio, seq_cfg.sampling_rate)
176
+ log.info(f"Audio saved to {save_path}")
177
+ save_paths.append(str(save_path))
178
  if device == "cuda":
179
  torch.cuda.empty_cache()
180