From 254a965aa4241eb72ce221e62d20a1e3074b6aec Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 7 Sep 2024 12:21:45 +0300 Subject: [PATCH] examples : add missing samplers --- examples/batched.swift/Sources/main.swift | 1 + examples/batched/batched.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/batched.swift/Sources/main.swift b/examples/batched.swift/Sources/main.swift index fbb9a92b349a9d..c17357b7ceee03 100644 --- a/examples/batched.swift/Sources/main.swift +++ b/examples/batched.swift/Sources/main.swift @@ -64,6 +64,7 @@ defer { llama_sampler_chain_add(smpl, llama_sampler_init_top_k(40)); llama_sampler_chain_add(smpl, llama_sampler_init_top_p(0.9, 1)); llama_sampler_chain_add(smpl, llama_sampler_init_temp (0.4)); +llama_sampler_chain_add(smpl, llama_sampler_init_dist (1234)); let n_ctx = llama_n_ctx(context) diff --git a/examples/batched/batched.cpp b/examples/batched/batched.cpp index 7ab7eed79c307c..f321f61047ad5a 100644 --- a/examples/batched/batched.cpp +++ b/examples/batched/batched.cpp @@ -71,6 +71,7 @@ int main(int argc, char ** argv) { llama_sampler_chain_add(smpl, llama_sampler_init_top_k(params.sparams.top_k)); llama_sampler_chain_add(smpl, llama_sampler_init_top_p(params.sparams.top_p, params.sparams.min_keep)); llama_sampler_chain_add(smpl, llama_sampler_init_temp (params.sparams.temp)); + llama_sampler_chain_add(smpl, llama_sampler_init_dist (params.sparams.seed)); if (ctx == NULL) { fprintf(stderr , "%s: error: failed to create the llama_context\n" , __func__);