]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
read n_ctx back after making llama_context (#21939)
authorMatt <redacted>
Wed, 15 Apr 2026 07:24:57 +0000 (00:24 -0700)
committerGitHub <redacted>
Wed, 15 Apr 2026 07:24:57 +0000 (15:24 +0800)
examples/diffusion/diffusion-cli.cpp

index e9780407da4e3b4897d9bee42ba9bfbc34c57e85..403b9b474454c4dcbc657d70a37202a22f08cb0c 100644 (file)
@@ -602,8 +602,8 @@ int main(int argc, char ** argv) {
 
     int n_input = input_tokens.size();
 
-    if (n_input >= params.n_ctx) {
-        LOG_ERR("error: input too long (%d tokens), max context is %d\n", n_input, params.n_ctx);
+    if (static_cast<uint32_t>(n_input) >= llama_n_ctx(ctx)) {
+        LOG_ERR("error: input too long (%d tokens), max context is %d\n", n_input, llama_n_ctx(ctx));
         llama_free(ctx);
         llama_model_free(model);
         return 1;