BendMlLlama.sample: def of bend-ml-llama@0.2.1.0 Import: import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama Lines 1260-1264 of bend-ml-llama@0.2.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-llama@0.2.1.0/main.bend&start_line=1260&end_line=1264 import Base # a token drawn from the logits xs (its id and logit) with temperature temp > 0, the k > 0 largest logits and top-p # p, by the uniform draw u def sample(+xs: List<&2, F32>, +temp: F32, +k: Nat, +p: F32, +u: F32) -> Cand: +cs = topk(k, xs) sample.cs(cs, temp, top_of(cs), p, u) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-ml-llama@0.2.1.0/main.bend&name=Cand https://jend.leeeet.dev/definition.txt?path=bend-ml-llama@0.2.1.0/main.bend&name=sample.cs https://jend.leeeet.dev/definition.txt?path=bend-ml-llama@0.2.1.0/main.bend&name=top_of https://jend.leeeet.dev/definition.txt?path=bend-ml-llama@0.2.1.0/main.bend&name=topk