Panic while transcribing audio.wav
meowcoder opened this issue · 1 comments
meowcoder commented
thread 'main' panicked at 'slice index starts at 172409 but ends at 168511',
/tmp/whisper-burn/src/transcribe.rs:101:22
whisper-burn/src/transcribe.rs
Line 95 in 3757c15
Here waveform.len()
could be less than n_samples_per_tensor
, which results in iter_len
to be extremely large:
[src/transcribe.rs:97] n_samples_per_tensor = 238559
[src/transcribe.rs:97] waveform.len() = 168511
[src/transcribe.rs:97] waveform.len() - n_samples_per_tensor = 18446744073709481568
Replacing subtraction with saturating_sub
fixes the issue.
Gadersd commented
Nice catch! I just pushed your correction.