-
in the "generate" function with temperature sampling and top-k sampling could be the "Sample from the distribution" indipendent from the temperature setting allowing the sampling features without the temperature rescaling ? def generate(model, idx, max_new_tokens, context_size, temperature, top_k=None, do_sample=True): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Good question. Yes, you can sample via Actually, Exercise 5.2 is kind of related to what you are asking :)
|
Beta Was this translation helpful? Give feedback.
Good question. Yes, you can sample via
torch.multinomial
without temperature scaling (default). And you can also simulate the greedy decoding via argmax if you set the temperature to 0.Actually, Exercise 5.2 is kind of related to what you are asking :)