sampling : add comments about backend sampler [no ci]
This commit adds a comment to llama_context's constructor explaining why backend samplers are initialized early in the process.
This commit is contained in:
parent
5ea3be265b
commit
172208afbf
|
|
@ -58,7 +58,9 @@ llama_context::llama_context(
|
|||
cparams.cb_eval = params.cb_eval;
|
||||
cparams.cb_eval_user_data = params.cb_eval_user_data;
|
||||
|
||||
// backend samplers
|
||||
// Initialize backend samplers here so they are part of the sampling graph
|
||||
// before the reserve passes run later in this function. This avoids a later
|
||||
// re-reserve when graph nodes change.
|
||||
if (params.samplers != nullptr && params.n_samplers > 0) {
|
||||
sampling.samplers.reserve(params.n_samplers);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue