Spaces:
Running
Running
whisper : fix extra memory usage (#2534)
Browse files* passing samples_padded by ref to the threads.
* passing samples_padded by ref to the threads.
---------
Co-authored-by: Vinith Misra <[email protected]>
- src/whisper.cpp +1 -1
src/whisper.cpp
CHANGED
|
@@ -3164,7 +3164,7 @@ static bool log_mel_spectrogram(
|
|
| 3164 |
std::vector<std::thread> workers(n_threads - 1);
|
| 3165 |
for (int iw = 0; iw < n_threads - 1; ++iw) {
|
| 3166 |
workers[iw] = std::thread(
|
| 3167 |
-
log_mel_spectrogram_worker_thread, iw + 1, hann, samples_padded,
|
| 3168 |
n_samples + stage_2_pad, frame_size, frame_step, n_threads,
|
| 3169 |
std::cref(filters), std::ref(mel));
|
| 3170 |
}
|
|
|
|
| 3164 |
std::vector<std::thread> workers(n_threads - 1);
|
| 3165 |
for (int iw = 0; iw < n_threads - 1; ++iw) {
|
| 3166 |
workers[iw] = std::thread(
|
| 3167 |
+
log_mel_spectrogram_worker_thread, iw + 1, hann, std::cref(samples_padded),
|
| 3168 |
n_samples + stage_2_pad, frame_size, frame_step, n_threads,
|
| 3169 |
std::cref(filters), std::ref(mel));
|
| 3170 |
}
|