Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def denoise(filename, ckpt_path = CHECKPOINT):
|
|
66 |
|
67 |
# inference
|
68 |
batch_size = 1000000
|
69 |
-
new_file_name =
|
70 |
noisy_audio = load_simple(filename)
|
71 |
LENGTH = len(noisy_audio[0].squeeze())
|
72 |
noisy_audio = torch.chunk(noisy_audio, LENGTH // batch_size + 1, dim=1)
|
@@ -80,7 +80,7 @@ def denoise(filename, ckpt_path = CHECKPOINT):
|
|
80 |
|
81 |
all_audio = np.concatenate(all_audio, axis=0)
|
82 |
print("saved to:", new_file_name)
|
83 |
-
sf.write(new_file_name, all_audio.squeeze(), 32000)
|
84 |
|
85 |
return new_file_name
|
86 |
|
|
|
66 |
|
67 |
# inference
|
68 |
batch_size = 1000000
|
69 |
+
new_file_name = "denoised_" + filename
|
70 |
noisy_audio = load_simple(filename)
|
71 |
LENGTH = len(noisy_audio[0].squeeze())
|
72 |
noisy_audio = torch.chunk(noisy_audio, LENGTH // batch_size + 1, dim=1)
|
|
|
80 |
|
81 |
all_audio = np.concatenate(all_audio, axis=0)
|
82 |
print("saved to:", new_file_name)
|
83 |
+
sf.write(new_file_name, np.ravel(all_audio.squeeze()), 32000)
|
84 |
|
85 |
return new_file_name
|
86 |
|