summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKawrakow <iwankawrakow@gmail.com>2025-07-03 15:26:52 +0200
committerGitHub <noreply@github.com>2025-07-03 15:26:52 +0200
commitdb8dee50516d1437f94017de196f87dcf54be12d (patch)
tree03fec5bae46d8c76920d2a3e2cd16fb8599a40d9 /src
parentab22474d77ecc846eaf102011f866b1d767f3ad5 (diff)
Do not crash when there is no DRY sampler (#578)
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/llama.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/llama.cpp b/src/llama.cpp
index 8823ab5b..c2769e32 100644
--- a/src/llama.cpp
+++ b/src/llama.cpp
@@ -23401,6 +23401,9 @@ struct llama_sampler_dry* llama_sampler_dry_clone(struct llama_sampler_dry* smpl
}
void llama_sampler_dry_accept(struct llama_sampler_dry* smpl, llama_token token) {
+ if (!smpl) {
+ return;
+ }
if (smpl->dry_multiplier == 0.0f || smpl->dry_base < 1.0f || smpl->dry_penalty_last_n == 0) {
return;
}