Spaces:
Running
Running
add app.py
Browse files
app.py
CHANGED
|
@@ -29,12 +29,7 @@ def denoise(inputs):
|
|
| 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 |
-
)
|
| 38 |
denoised = (denoised * 32767.0).numpy().astype("int16")
|
| 39 |
|
| 40 |
print(f"Denoised shape: {denoised.shape}")
|
|
|
|
| 29 |
clean_chunk = MODEL(audio_chunk[None]).logits
|
| 30 |
clean.append(clean_chunk.squeeze(0))
|
| 31 |
|
| 32 |
+
denoised = torch.concat(clean).flatten()[: audio.shape[-1]].clamp(-1.0, 1.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
denoised = (denoised * 32767.0).numpy().astype("int16")
|
| 34 |
|
| 35 |
print(f"Denoised shape: {denoised.shape}")
|