huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
135.19k stars 27.06k forks source link

It seems not able to add the args "repetition_penalty" when running the code run_summarization.py for prediction. #11975

Closed moooooser999 closed 3 years ago

moooooser999 commented 3 years ago

I am using the summarization code provided in example/pytorch/summarization/run_summarization.py

However, I could not add the argument "repetition_penalty" when generating.

After tracing the source code of Seq2SeqTrainer(), I found that the function predict() does not take the argument as input.

It might be helpful if the arguments the function takes could be much more flexible. For now, it only takes max_len and num_beams for the function generate()

patil-suraj commented 3 years ago

Yes, that's right. The run_summarization script does not accept all generate arguments. Instead, those arguments should be set in the config. For your use-case, it should easy to modify the script to accept these args and then pass those to config so generate can directly access those.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.