from typing import Optional, Sequence, Union

from ..base import BaseModel


class SamplingParams(BaseModel):
    max_tokens: Optional[int] = None
    """要生成的最大 token 长度"""

    seed: Optional[int] = None
    """随机种子"""

    stop: Union[str, Sequence[str], Sequence[int], None] = None
    """停止生成的 token id 列表"""

    temperature: float = 1
    """温度"""

    top_k: int = -1
    """top-k 采样"""

    top_p: float = 1
    """top-p 采样"""

    ignore_eos: bool = False
    """是否忽略 EOS token"""
