For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
SamplerInputs
SamplerInputs
class max.pipelines.sampling.SamplerInputs(top_k, max_k, temperature, top_p, min_top_p, min_p, seed)
Bases: object
Container for sampler inputs.
-
Parameters:
as_list()
as_list()
Returns the sampler inputs as a list of buffers.
create()
classmethod create(batch, device)
Create sampling parameter tensors from context batch.
-
Parameters:
-
- batch (list[TextContext]) – List of context objects containing sampling parameters.
- device (Device) – Device to place the tensors on.
-
Returns:
-
SamplerInputs containing the sampling parameter tensors.
-
Return type:
max_k
max_k: Buffer
min_p
min_p: Buffer
min_top_p
min_top_p: Buffer
seed
seed: Buffer
temperature
temperature: Buffer
top_k
top_k: Buffer
top_p
top_p: Buffer