From 986d6c04fd274e6a6c31c9758126ab5571dbfff9 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 19 Dec 2022 20:17:10 +0200 Subject: [PATCH] minor : fix warning --- whisper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper.cpp b/whisper.cpp index 9f9997a..2c5e8c2 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2360,7 +2360,7 @@ struct whisper_token_data whisper_sample_timestamp(struct whisper_context * ctx, int whisper_tokenize(struct whisper_context * ctx, const char * text, whisper_token * tokens, int n_max_tokens) { const auto res = tokenize(ctx->vocab, text); - if (res.size() > n_max_tokens) { + if (n_max_tokens < (int) res.size()) { fprintf(stderr, "%s: too many resulting tokens: %d (max %d)\n", __func__, (int) res.size(), n_max_tokens); return -1; }