summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfirecoperana <xuqiaowei1124@gmail.com>2025-07-06 00:51:36 -0500
committerGitHub <noreply@github.com>2025-07-06 07:51:36 +0200
commit22f67917f63bd222b73a4581e9892d2b2a427bde (patch)
tree4e861d9c0fbcd5bb5c68279e171c3fff69896470
parent4622fadc2a2665b731a5887f93e295f0331ed80e (diff)
Fix server crash when there is no DRY sampler (#588)
Co-authored-by: firecoperana <firecoperana>
-rw-r--r--src/llama.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/llama.cpp b/src/llama.cpp
index 8c16e778..3ee95939 100644
--- a/src/llama.cpp
+++ b/src/llama.cpp
@@ -23363,6 +23363,9 @@ struct llama_sampler_dry * llama_sampler_init_dry(const struct llama_vocab* voca
}
void llama_sampler_dry_reset(struct llama_sampler_dry* smpl) {
+ if (!smpl) {
+ return;
+ }
smpl->last_tokens.clear();
smpl->dry_repeat_count.clear();
smpl->dry_max_token_repeat.clear();