8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d71582d commit 261f397Copy full SHA for 261f397
crates/llama_cpp/src/lib.rs
@@ -112,9 +112,13 @@ pub struct Token(pub i32);
112
#[error("an internal assertion failed in llama.cpp; check `tracing` output.")]
113
pub struct LlamaInternalError;
114
115
-/// This needs to be documented!
+/// Something which selects a [`Token`] from the distribution output by a
116
+/// [`LlamaModel`].
117
pub trait Sampler {
- /// This needs to be documented!
118
+ /// Given a [`llama_context`], the tokens in context (to allow for
119
+ /// repetition penalities), and a [`llama_token_data_array`] (which contains
120
+ /// the distribution over the next token as output by the model), selects a
121
+ /// token.
122
fn sample(
123
&mut self,
124
context: *mut llama_context,
0 commit comments