From a0c0d08d0f6bc0726c2f3ad2eb4bbfb4dbc1e171 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 7 Nov 2023 13:45:56 +0200 Subject: [PATCH] bench : fix n_mels --- examples/bench.wasm/emscripten.cpp | 4 ++-- examples/bench/bench.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bench.wasm/emscripten.cpp b/examples/bench.wasm/emscripten.cpp index cc761485..083397db 100644 --- a/examples/bench.wasm/emscripten.cpp +++ b/examples/bench.wasm/emscripten.cpp @@ -23,9 +23,9 @@ void bench_main(size_t index) { fprintf(stderr, "%s: running benchmark with %d threads - please wait...\n", __func__, n_threads); - const int n_mel = 80; + const int n_mels = whisper_model_n_mels(ctx); - if (int ret = whisper_set_mel(ctx, nullptr, 0, n_mel)) { + if (int ret = whisper_set_mel(ctx, nullptr, 0, n_mels)) { fprintf(stderr, "error: failed to set mel: %d\n", ret); return; } diff --git a/examples/bench/bench.cpp b/examples/bench/bench.cpp index a16c0f7f..db1c4e80 100644 --- a/examples/bench/bench.cpp +++ b/examples/bench/bench.cpp @@ -73,9 +73,9 @@ int whisper_bench_full(const whisper_params & params) { return 2; } - const int n_mel = 80; + const int n_mels = whisper_model_n_mels(ctx); - if (int ret = whisper_set_mel(ctx, nullptr, 0, n_mel)) { + if (int ret = whisper_set_mel(ctx, nullptr, 0, n_mels)) { fprintf(stderr, "error: failed to set mel: %d\n", ret); return 3; }