Type Alias: ChatSampler
ts
type ChatSampler = "greedy" | "top-k" | "top-p";Defined in: src/batteries/llm/chat_common/generation.ts:30
The portable sampler strategy. Maps to each battery's native mechanism:
'greedy'— deterministic argmax. transformers.jsdo_sample:false; LiteRTSamplerType.GREEDY(which is top-1, sokis forced to 1).'top-k'— sample from the top-klogits. transformers.jsdo_sample:true+top_k; LiteRTSamplerType.TOP_K+k.'top-p'— nucleus sampling. transformers.jsdo_sample:true+top_p; LiteRTSamplerType.TOP_P+p.