From 854e1295cca982e16478045a2b4b7386bc49491b Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Tue, 28 Nov 2023 16:20:33 +0000 Subject: [PATCH] Fix problem with n_tokens==0 --- native/jni/src/ggml/context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/src/ggml/context.cpp b/native/jni/src/ggml/context.cpp index e2a94857c..44e8a706d 100644 --- a/native/jni/src/ggml/context.cpp +++ b/native/jni/src/ggml/context.cpp @@ -15,7 +15,7 @@ std::pair transformer_context_fastfor // Handle the case when we have a shorter input than active context, requiring the last // token to be recomputed to get up-to-date logits - if((npast == next_context.size()) && (next_context.size() < ctx.active_context.size())) { + if((npast == next_context.size()) && (next_context.size() <= ctx.active_context.size())) { npast -= 1; }