azamat commited on
Commit
9ca6f22
1 Parent(s): 73e61ac
Files changed (2) hide show
  1. app.py +5 -5
  2. 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
- for batch in tqdm(noisy_audio):
75
- with torch.no_grad():
76
- generated_audio = sampling(net, batch)
77
- generated_audio = generated_audio.cpu()
78
- sf.write(out, np.ravel(generated_audio.squeeze()), SAMPLE_RATE)
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.8.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