Skip to content

SamplingParams

Source code in docs_src/capo_sagemakertrainingsessionruntime/types/sampling_params.py
class SamplingParams(TypedDict, closed=True):
    max_tokens: "int"
    """<p>The maximum number of tokens to generate per sample.</p>"""
    temperature: "float"
    """<p>The sampling temperature controlling randomness. Higher values produce more diverse outputs.</p>"""
    top_k: "int"
    """<p>The number of highest-probability vocabulary tokens to keep for top-k filtering. Set to -1 to disable.</p>"""
    top_p: "float"
    """<p>The cumulative probability threshold for nucleus (top-p) sampling. Only tokens with cumulative probability below this threshold are considered.</p>"""
    seed: NotRequired["int"]
    """<p>The random seed for reproducible sampling. When set, the same seed with the same input produces deterministic outputs.</p>"""
    stop: NotRequired[
        "capo_sagemakertrainingsessionruntime.types.stop_sequence_list.StopSequenceList"
    ]
    """<p>The list of stop sequences that terminate generation when encountered in the output.</p>"""

max_tokens instance-attribute

max_tokens: int

The maximum number of tokens to generate per sample.

seed instance-attribute

seed: NotRequired[int]

The random seed for reproducible sampling. When set, the same seed with the same input produces deterministic outputs.

stop instance-attribute

stop: NotRequired[StopSequenceList]

The list of stop sequences that terminate generation when encountered in the output.

temperature instance-attribute

temperature: float

The sampling temperature controlling randomness. Higher values produce more diverse outputs.

top_k instance-attribute

top_k: int

The number of highest-probability vocabulary tokens to keep for top-k filtering. Set to -1 to disable.

top_p instance-attribute

top_p: float

The cumulative probability threshold for nucleus (top-p) sampling. Only tokens with cumulative probability below this threshold are considered.