Spaces:
Running
Running
add app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,13 @@ def denoise(inputs):
|
|
29 |
clean_chunk = MODEL(audio_chunk[None]).logits
|
30 |
clean.append(clean_chunk.squeeze(0))
|
31 |
|
32 |
-
denoised =
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
return MODEL.config.sample_rate, denoised
|
38 |
|
|
|
29 |
clean_chunk = MODEL(audio_chunk[None]).logits
|
30 |
clean.append(clean_chunk.squeeze(0))
|
31 |
|
32 |
+
denoised = (
|
33 |
+
torch.concat(clean)
|
34 |
+
.flatten()
|
35 |
+
.unsqueeze(0)[:, : audio.shape[-1]]
|
36 |
+
.clamp(-1.0, 1.0)
|
37 |
+
.numpy()
|
38 |
+
)
|
39 |
|
40 |
return MODEL.config.sample_rate, denoised
|
41 |
|