]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Server: Enable setting default sampling parameters via command-line (#8402)
authorClint Herron <redacted>
Tue, 9 Jul 2024 22:26:40 +0000 (18:26 -0400)
committerGitHub <redacted>
Tue, 9 Jul 2024 22:26:40 +0000 (18:26 -0400)
* Load server sampling parameters from the server context by default.

* Wordsmithing comment

examples/server/server.cpp

index 47bea159136001e2a49431dcdd896f5f130b54ea..8feff67029da1a1cc1705af805f28559e6866819 100644 (file)
@@ -884,7 +884,8 @@ struct server_context {
 
     bool launch_slot_with_task(server_slot & slot, const server_task & task) {
         slot_params default_params;
-        llama_sampling_params default_sparams;
+        // Sampling parameter defaults are loaded from the global server context (but individual requests can still override them)
+        llama_sampling_params default_sparams = params.sparams;
         auto & data = task.data;
 
         if (data.count("__oaicompat") != 0) {