Remove channel num check
#1
by
bigmoyan
- opened
- processor_omni.py +1 -1
processor_omni.py
CHANGED
@@ -255,7 +255,7 @@ class OmniAudioProcessor:
|
|
255 |
|
256 |
def load_audio_waveform(self, uri, return_tensors=True, do_normalize=False):
|
257 |
metadata = torchaudio.info(uri) # sample_rate, num_frames, num_channels, bits_per_sample, encoding=PCM_S
|
258 |
-
assert(metadata.num_channels <= 2), "acoustic file with {} channels.".format(metadata.num_channels) # whisper only accept mono channel audio
|
259 |
waveform_tensor, _ = torchaudio.load(uri, normalize=True)
|
260 |
if self.config.sampling_rate != metadata.sample_rate:
|
261 |
waveform_tensor = torchaudio.functional.resample(waveform_tensor, metadata.sample_rate, self.config.sampling_rate, lowpass_filter_width=128)
|
|
|
255 |
|
256 |
def load_audio_waveform(self, uri, return_tensors=True, do_normalize=False):
|
257 |
metadata = torchaudio.info(uri) # sample_rate, num_frames, num_channels, bits_per_sample, encoding=PCM_S
|
258 |
+
# assert(metadata.num_channels <= 2), "acoustic file with {} channels.".format(metadata.num_channels) # whisper only accept mono channel audio
|
259 |
waveform_tensor, _ = torchaudio.load(uri, normalize=True)
|
260 |
if self.config.sampling_rate != metadata.sample_rate:
|
261 |
waveform_tensor = torchaudio.functional.resample(waveform_tensor, metadata.sample_rate, self.config.sampling_rate, lowpass_filter_width=128)
|