File size: 674 Bytes
31dc8dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from dataclasses import dataclass
from typing import Literal
@dataclass
class SamplingParams:
temperature: float = 1.0
max_tokens: int = 64
ignore_eos: bool = False
# Block Diffusion Parameters
block_length: int = 4
denoising_steps: int = 4
dynamic_threshold: float = 0.9
eb_threshold: float = 0.35
topk: int = 0
topp: float = 1
remasking_strategy: Literal['sequential', 'low_confidence_static', 'low_confidence_dynamic', 'entropy_bounded'] = 'low_confidence_static'
stop_words: list[int] | None = None
random_init_ratio: float = 0.0 # Ratio of random tokens in block initialization (0.0 = all masks, 1.0 = all random)
|