Merge 49c833dceeaaf45b8a73df4531ac8ee18f4ec5e9 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2

This commit is contained in:
Madhumitha Kolkar 2025-06-27 02:27:50 +00:00 committed by GitHub
commit 84d6f9c686
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,9 @@ def log_mel_spectrogram(
audio = load_audio(audio) audio = load_audio(audio)
audio = torch.from_numpy(audio) audio = torch.from_numpy(audio)
if len(audio) < N_SAMPLES: # Check if audio length is less than expected
raise ValueError("Input audio length is shorter than the expected length.")
if device is not None: if device is not None:
audio = audio.to(device) audio = audio.to(device)
if padding > 0: if padding > 0: