minor : fix warning

pull/294/head
Georgi Gerganov 3 years ago committed by GitHub
parent 7ef8ab60fd
commit 986d6c04fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;
}

Loading…
Cancel
Save