Skip to content

Is it possible to set repetition_penalty? #174

Answered by slundberg
ein-ich asked this question in Q&A
Discussion options

You must be logged in to vote

Good question! I just added a new kwargs passthrough to the gen command to address this. Now you can pass anything through the transformers generate, like repetition_penalty. Just note that some parameters that change the output of the generate command would break things I think (like num_beams).

You should be able to use anything in the "Parameters for manipulation of the model output logits" section at https://huggingface.co/docs/transformers/main_classes/text_generation#transformers.GenerationConfig

This is in main now and will be part of 0.0.62 when it comes out.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@chrisfentiman
Comment options

@jelling
Comment options

@AtharvanDogra
Comment options

Answer selected by slundberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants