8000 Add top_n_sigma and grammar_lazy samplers; Add reset and get_seed methods to LlamaSampler by nhaghighat · Pull Request #672 · utilityai/llama-cpp-rs · GitHub
[go: up one dir, main page]

Skip to content

Add top_n_sigma and grammar_lazy samplers; Add reset and get_seed methods to LlamaSampler #672

< 8000 /div>
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add reset sampler
  • Loading branch information
nhaghighat committed Feb 22, 2025
commit 71a8e22a0a84091e19bdc0cdb06467ab4b36cdf4
9 changes: 9 additions & 0 deletions llama-cpp-2/src/sampling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ impl LlamaSampler {
self
}

/// Resets the internal state of the sampler.
///
/// This can be useful when you want to start fresh with a sampler without creating a new instance.
pub fn reset(&mut self) {
unsafe {
llama_cpp_sys_2::llama_sampler_reset(self.sampler);
}
}

/// Combines a list of samplers into a single sampler that applies each component sampler one
/// after another.
///
Expand Down
0