Spaces:
Runtime error
Runtime error
fix
Browse files- app.py +5 -5
- requirements.txt +1 -1
app.py
CHANGED
@@ -71,11 +71,11 @@ def denoise(filename, ckpt_path = CHECKPOINT, out = "out.wav"):
|
|
71 |
# inference
|
72 |
noisy_audio = load_simple(filename)
|
73 |
|
74 |
-
|
75 |
-
with torch.
|
76 |
-
generated_audio = sampling(net,
|
77 |
-
generated_audio = generated_audio.cpu()
|
78 |
-
sf.write(out, np.ravel(generated_audio
|
79 |
|
80 |
return out
|
81 |
|
|
|
71 |
# inference
|
72 |
noisy_audio = load_simple(filename)
|
73 |
|
74 |
+
with torch.no_grad():
|
75 |
+
with torch.cuda.amp.autocast():
|
76 |
+
generated_audio = sampling(net, noisy_audio)
|
77 |
+
generated_audio = generated_audio[0].squeeze().cpu().numpy()
|
78 |
+
sf.write(out, np.ravel(generated_audio), SAMPLE_RATE)
|
79 |
|
80 |
return out
|
81 |
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
pillow==6.2.0
|
2 |
torch
|
3 |
-
torchaudio==0.
|
4 |
inflect==4.1.0
|
5 |
soundfile
|
6 |
scipy
|
|
|
1 |
pillow==6.2.0
|
2 |
torch
|
3 |
+
torchaudio==0.13.1
|
4 |
inflect==4.1.0
|
5 |
soundfile
|
6 |
scipy
|