]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper : fix extra memory usage (#2534)
authorVin Misra <redacted>
Wed, 6 Nov 2024 21:02:11 +0000 (13:02 -0800)
committerGitHub <redacted>
Wed, 6 Nov 2024 21:02:11 +0000 (23:02 +0200)
* passing samples_padded by ref to the threads.

* passing samples_padded by ref to the threads.

---------

Co-authored-by: Vinith Misra <redacted>
src/whisper.cpp

index 08f1ef01752fda693a1c8c6ab7c14b605e92d3ac..e97a6883f89749d6b34b155f348c719e463248a4 100644 (file)
@@ -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));
         }