microsoft / ProphetNet

A research project for natural language generation, containing the official implementations by MSRA NLC team.
MIT License
686 stars 109 forks source link

Loading .pt into fairseq model for customisation #2

Closed chrisdoyleIE closed 4 years ago

chrisdoyleIE commented 4 years ago

Hi guys,

really incredible work, thank you.

May I please ask for a way of loading the available checkpoints into its fairseq model, such that someone can build upon your architecture?

Specifically, the "bpe" and "bpe_codes" arguments as below are what I'm trying to identify.

Screenshot 2020-04-05 at 13 59 44
chrisdoyleIE commented 4 years ago

Solution:

The only required arguments concern the .pt itself for fairseq.TransformModel.from_pretrained(), so the snippet in the issue itself is sufficient, without reference to bpe.

The below snippet is the definition for fairseq.BaseFairseqModel.from_pretrained()

Screenshot 2020-04-05 at 14 10 24