From fb14faf6b09bd3ffce7e028bf0732c55924620b1 Mon Sep 17 00:00:00 2001 From: Evan Jones Date: Sat, 3 Jun 2023 07:00:42 -0400 Subject: [PATCH] clang-tidy Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- examples/main/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 587fcb036..57cc1e486 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -204,7 +204,7 @@ int main(int argc, char ** argv) { // if we will use the cache for the full prompt without reaching the end of the cache, force // reevaluation of the last token token to recalculate the cached logits - if (embd_inp.size() && n_matching_session_tokens == embd_inp.size() && + if (!embd_inp.empty() && n_matching_session_tokens == embd_inp.size() && session_tokens.size() > embd_inp.size()) { session_tokens.resize(embd_inp.size() - 1); }