Skip to content

Commit b199030

Browse files
committed
put benchmark back
1 parent 43ab151 commit b199030

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/whisper.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,6 @@ whisper_download_model <- function(x = c("tiny", "tiny.en", "base", "base.en", "
221221
whisper_benchmark <- function(object = whisper(system.file(package = "audio.whisper", "models", "for-tests-ggml-tiny.bin")),
222222
threads = 1){
223223
stopifnot(inherits(object, "whisper"))
224-
#whisper_print_benchmark(object$model, threads)
224+
whisper_print_benchmark(object$model, threads)
225225
invisible()
226226
}

src/rcpp_whisper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ Rcpp::List whisper_encode(SEXP model, std::string path, std::string language,
491491

492492

493493

494-
/*
494+
495495
// [[Rcpp::export]]
496496
void whisper_print_benchmark(SEXP model, int n_threads = 1) {
497497
whisper_params params;
@@ -501,12 +501,12 @@ void whisper_print_benchmark(SEXP model, int n_threads = 1) {
501501
struct whisper_context * ctx = whispermodel->ctx;
502502
Rprintf("\n");
503503
Rprintf("system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
504-
if (int ret = whisper_set_mel(ctx, nullptr, 0, WHISPER_N_MEL)) {
504+
const int n_mels = whisper_model_n_mels(ctx);
505+
if (int ret = whisper_set_mel(ctx, nullptr, 0, n_mels)) {
505506
Rprintf("error: failed to set mel: %d\n", ret);
506507
}
507508
if (int ret = whisper_encode(ctx, 0, params.n_threads) != 0) {
508509
Rprintf("error: failed to encode model: %d\n", ret);
509510
}
510511
whisper_print_timings(ctx);
511512
}
512-
*/

0 commit comments

Comments
 (0)