Chapter 241 / 5
Inference & Serving
Implement temperature + top- + top- sampling from a logits vector in numpy
Easy
Target interface
sample(logits, temperature=1.0, top_k=0, top_p=1.0, rng=None)Implement the function/class skeleton in the editor. Any correct approach is accepted.
Hints0 / 2
Reference solution
Your own code stays in the editor.