mirror of
https://github.com/openai/whisper.git
synced 2025-11-26 15:35:57 +00:00
Merge 49c833dceeaaf45b8a73df4531ac8ee18f4ec5e9 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2
This commit is contained in:
commit
84d6f9c686
@ -140,6 +140,9 @@ def log_mel_spectrogram(
|
||||
audio = load_audio(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:
|
||||
audio = audio.to(device)
|
||||
if padding > 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user