Skip to content

vllm.v1.watermarking.gpu_sampler

Classes:

GPUWatermarkSampler

Bases: Sampler

_get_contexts(expanded_idx_mapping, expanded_local_pos=None, draft_sampled=None)

Build contexts for flattened verification rows.

With committed tokens [10, 11], drafts [20, 21], and width 2, local positions [0, 1, 2] use contexts [10, 11], [11, 20], and [20, 21]. The first verification row precedes the first draft.