Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -299,21 +299,24 @@ def voice_conversion(input, reference, steps, guidance, pitch, speed):
|
|
299 |
vc_target = inference_module.cfm.inference(cat_condition, torch.LongTensor([cat_condition.size(1)]).to(mel2.device), mel2, style2, None, steps, inference_cfg_rate=guidance)
|
300 |
vc_target = vc_target[:, :, mel2.size(2):]
|
301 |
print(f"[INFO] | vc_target shape: {vc_target.shape}")
|
302 |
-
|
|
|
|
|
|
|
|
|
303 |
# Generate waveform using BigVGAN
|
|
|
304 |
vc_wave = bigvgan_fn(vc_target.float())[0]
|
305 |
print(f"[INFO] | vc_wave shape: {vc_wave.shape}")
|
306 |
-
|
307 |
# Handle the generated waveform
|
308 |
output_wave = vc_wave[0].cpu().numpy()
|
309 |
generated_wave_chunks.append(output_wave)
|
|
|
310 |
|
311 |
# Ensure processed_frames increments correctly to avoid infinite loop
|
312 |
-
print(processed_frames)
|
313 |
-
print(cond.size(1))
|
314 |
processed_frames += vc_target.size(2)
|
315 |
-
|
316 |
-
print(cond.size(1))
|
317 |
print(f"[INFO] | Processed frames updated to: {processed_frames}")
|
318 |
|
319 |
# Concatenate all generated wave chunks
|
|
|
299 |
vc_target = inference_module.cfm.inference(cat_condition, torch.LongTensor([cat_condition.size(1)]).to(mel2.device), mel2, style2, None, steps, inference_cfg_rate=guidance)
|
300 |
vc_target = vc_target[:, :, mel2.size(2):]
|
301 |
print(f"[INFO] | vc_target shape: {vc_target.shape}")
|
302 |
+
|
303 |
+
# TEMP
|
304 |
+
output_wave = vc_target[0].cpu().numpy()
|
305 |
+
generated_wave_chunks.append(output_wave)
|
306 |
+
|
307 |
# Generate waveform using BigVGAN
|
308 |
+
"""
|
309 |
vc_wave = bigvgan_fn(vc_target.float())[0]
|
310 |
print(f"[INFO] | vc_wave shape: {vc_wave.shape}")
|
311 |
+
|
312 |
# Handle the generated waveform
|
313 |
output_wave = vc_wave[0].cpu().numpy()
|
314 |
generated_wave_chunks.append(output_wave)
|
315 |
+
"""
|
316 |
|
317 |
# Ensure processed_frames increments correctly to avoid infinite loop
|
|
|
|
|
318 |
processed_frames += vc_target.size(2)
|
319 |
+
|
|
|
320 |
print(f"[INFO] | Processed frames updated to: {processed_frames}")
|
321 |
|
322 |
# Concatenate all generated wave chunks
|