Skip to content

Commit

Permalink
Merge pull request #589 from joneavila/add-greedy-decoding-to-example…
Browse files Browse the repository at this point in the history
…-simple

Add greedy decoding to example 'simple'
  • Loading branch information
MarcusDunn authored Dec 3, 2024
2 parents 798a677 + b18a86c commit 42a4a1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/simple/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ either reduce n_len or increase n_ctx"
let mut decoder = encoding_rs::UTF_8.new_decoder();

let sampler_params = LlamaSamplerChainParams::default();
let mut sampler = LlamaSampler::new(sampler_params)?.add_dist(seed.unwrap_or(1234));
let mut sampler = LlamaSampler::new(sampler_params)?
.add_dist(seed.unwrap_or(1234))
.add_greedy();

while n_cur <= n_len {
// sample the next token
Expand Down

0 comments on commit 42a4a1e

Please sign in to comment.