Skip to content

Commit

Permalink
whisper : fix extra memory usage (#2534)
Browse files Browse the repository at this point in the history
* passing samples_padded by ref to the threads.

* passing samples_padded by ref to the threads.

---------

Co-authored-by: Vinith Misra <[email protected]>
  • Loading branch information
vinmisra and Vinith Misra authored Nov 6, 2024
1 parent 0377596 commit 31aea56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3164,7 +3164,7 @@ static bool log_mel_spectrogram(
std::vector<std::thread> workers(n_threads - 1);
for (int iw = 0; iw < n_threads - 1; ++iw) {
workers[iw] = std::thread(
log_mel_spectrogram_worker_thread, iw + 1, hann, samples_padded,
log_mel_spectrogram_worker_thread, iw + 1, hann, std::cref(samples_padded),
n_samples + stage_2_pad, frame_size, frame_step, n_threads,
std::cref(filters), std::ref(mel));
}
Expand Down

0 comments on commit 31aea56

Please sign in to comment.