Spaces:
Running
Running
Update inference.py
Browse files- 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,
|
|
|
|
|
|
|
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)
|