]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama.cpp: fix warning message (#11839)
authorOleksandr Kuvshynov <redacted>
Thu, 13 Feb 2025 06:25:34 +0000 (01:25 -0500)
committerGitHub <redacted>
Thu, 13 Feb 2025 06:25:34 +0000 (08:25 +0200)
There was a typo-like error, which would print the same number twice if
request is received with n_predict > server-side config.

Before the fix:
```
slot launch_slot_: id  0 | task 0 | n_predict = 4096 exceeds server configuration, setting to 4096
```

After the fix:
```
slot launch_slot_: id  0 | task 0 | n_predict = 8192 exceeds server configuration, setting to 4096
```

examples/server/server.cpp

index d320e9d6b4c08f6d74ddbf55160c16c75dd9f01d..5a36cd2a8d7e402920d0796201af2a563836b12c 100644 (file)
@@ -2073,8 +2073,8 @@ struct server_context {
 
         if (slot.n_predict > 0 && slot.params.n_predict > slot.n_predict) {
             // Might be better to reject the request with a 400 ?
+            SLT_WRN(slot, "n_predict = %d exceeds server configuration, setting to %d", slot.params.n_predict, slot.n_predict);
             slot.params.n_predict = slot.n_predict;
-            SLT_WRN(slot, "n_predict = %d exceeds server configuration, setting to %d", slot.n_predict, slot.n_predict);
         }
 
         if (slot.params.ignore_eos && has_eos_token) {