Transformers: model.generate source code

Created on 30 Jun 2020  路  3Comments  路  Source: huggingface/transformers

Hi there,

I am trying to use BART to do NLG task. During my reading the BART tutorial on the website, I couldn't find the definition of 'model.generate()" function. Could you please add some explaination on that? thanks in advance

wontfix

Most helpful comment

All 3 comments

generate() is defined in the PretrainedModel class here https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_utils.py#L872. Given that BartModel, BartForConditionalGeneration, etc, inherit from PretrainedModel they all have access to this generate function.

Hope this help?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ereday picture ereday  路  3Comments

zhezhaoa picture zhezhaoa  路  3Comments

hsajjad picture hsajjad  路  3Comments

rsanjaykamath picture rsanjaykamath  路  3Comments

fyubang picture fyubang  路  3Comments