raspberryice / gen-arg

Code for paper "Document-Level Argument Extraction by Conditional Generation". NAACL 21'
MIT License
115 stars 29 forks source link

'BartConstrainedGen' object has no attribute 'postprocess_next_token_scores' #1

Closed Sethcat closed 3 years ago

Sethcat commented 3 years ago

Thanks for sharing the code!

I could successfully training model on the wikievents dataset. But got the error saying "'BartConstrainedGen' object has no attribute postprocess_next_token_scores" when run scripts/test_kairos.sh.

It seems postprocess_next_token_scores method is not include in the BartConstrainedGen class (src/genie/constrained_gen.py). Is there something missing in the code or any other cause ? Look forward to your reply!

raspberryice commented 3 years ago

Thanks for reporting this! The method was from an old version of the transformers library's GenerationMixin.I'm checking to see if directly including the method in the BartConstrainedGen class fixes the problem.

raspberryice commented 3 years ago

Hi Sethcat, Can you check if the updated src/genie/constrained_gen.py file works for you?

Sethcat commented 3 years ago

Thanks ! It works for me.