hieupham14022003 commited on
Commit
3b6c451
·
verified ·
1 Parent(s): de88ab6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -54,15 +54,15 @@ def seprate(mixed_voice_path, clean_voice_path, drop_down):
54
  e_mix = emb(mixed_voice)
55
  e = torch.cat([e,e_mix],dim=1)
56
  mixed_voice = torchaudio.functional.resample(mixed_voice, rate, 8000)
57
- with autocast(device_type='cpu', dtype=torch.bfloat16):
58
- with torch.no_grad():
59
- yHat = model(
60
- mixed_voice,
61
- e,
62
- )
63
- yHat = yHat.numpy().astype('float32')
64
- audio = gr.Audio(tuple((8000,yHat[0])),type='numpy')
65
- return audio
66
 
67
  def load_checkpoint(filepath):
68
  checkpoint = torch.load(
 
54
  e_mix = emb(mixed_voice)
55
  e = torch.cat([e,e_mix],dim=1)
56
  mixed_voice = torchaudio.functional.resample(mixed_voice, rate, 8000)
57
+ # with autocast(device_type='cpu', dtype=torch.bfloat16):
58
+ with torch.no_grad():
59
+ yHat = model(
60
+ mixed_voice,
61
+ e,
62
+ )
63
+ yHat = yHat.numpy().astype('float32')
64
+ audio = gr.Audio(tuple((8000,yHat[0])),type='numpy')
65
+ return audio
66
 
67
  def load_checkpoint(filepath):
68
  checkpoint = torch.load(