Skip to main content
Log in

Python module

sampling

Token sampling algorithms.

rejection_sampler()

max.pipelines.lib.sampling.rejection_sampler(top_k: int, device: DeviceRef) → Graph

token_sampler()

max.pipelines.lib.sampling.token_sampler(sampling_config: SamplingConfig, device: DeviceRef, return_logits: bool = False) → Graph