clef / code /models /common /sampling /sampling_params.py
tt-hous's picture
Add files using upload-large-folder tool
b025706 verified
Raw History Blame Contribute Delete
731 Bytes
# SPDX-FileCopyrightText: © 2026 Tenstorrent USA, Inc.
#
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass
@dataclass(frozen=True)
class SamplingParams:
"""
Used in Generator decode forward functions for greedy decoding / sampling on device.
The same data class exists in vLLM at vllm/v1/worker/tt_model_runner.py.
"""
temperature: float | list[float]
top_k: int | list[int]
top_p: float | list[float]
presence_penalty: float | list[float] = 0.0
frequency_penalty: float | list[float] = 0.0
repetition_penalty: float | list[float] = 1.0
seed: int | list[int] | None = None
enable_log_probs: bool | list[bool] = False
num_logprobs: int | list[int] = 0