Spaces:
Sleeping
Sleeping
Update inference.py
Browse files- inference.py +3 -0
inference.py
CHANGED
@@ -25,6 +25,9 @@ class InferencePipeline():
|
|
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")
|
|
|
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 |
+
print(f"Loading audio from: {audio_path}")
|
29 |
+
if not isinstance(audio_path, (str, bytes, os.PathLike)):
|
30 |
+
raise TypeError(f"Invalid type for audio_path: {type(audio_path)}. Expected str, bytes, or os.PathLike.")
|
31 |
|
32 |
# load source audio
|
33 |
source, sr = torchaudio.load(audio_path) #"test.wav")
|