File size: 731 Bytes
b025706 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # 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
|