Python function
max_tokens_to_generate
max_tokens_to_generate()β
max.pipelines.modeling.dataprocessing.max_tokens_to_generate(prompt_size, max_length, max_new_tokens=-1)
Returns the maximum number of new tokens to generate.
Respects both max_length (minus prompt_size) and, when non-negative,
max_new_tokens; returns the minimum of the two when both apply.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!