uzdzn commited on
Commit
6b6fc4f
1 Parent(s): 15564d2

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +4 -1
inference.py CHANGED
@@ -22,7 +22,10 @@ class InferencePipeline():
22
  self.trg_spk_emb = torch.from_numpy(self.trg_spk_emb)
23
  self.trg_spk_emb = self.trg_spk_emb.unsqueeze(0)#.cuda()
24
 
25
- def voice_conversion(self, audio_path):
 
 
 
26
  # load source audio
27
  source, sr = torchaudio.load(audio_path) #"test.wav")
28
  source = torchaudio.functional.resample(source, sr, 16000)
 
22
  self.trg_spk_emb = torch.from_numpy(self.trg_spk_emb)
23
  self.trg_spk_emb = self.trg_spk_emb.unsqueeze(0)#.cuda()
24
 
25
+ def voice_conversion(self, audio_data):
26
+ # Extract the file path from the tuple
27
+ audio_path = audio_data[0] if isinstance(audio_data, tuple) else audio_data
28
+
29
  # load source audio
30
  source, sr = torchaudio.load(audio_path) #"test.wav")
31
  source = torchaudio.functional.resample(source, sr, 16000)