question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Converting transformer-LM (GPT2) trained by fairseq to huggingface transformers

See original GitHub issue

After training transformer-LM using fairseq (--task language_modeling -- arch transformer_lm_gpt2_medium), I want to use this transformer-LM (GPT2-medium) by huggingface-transformers. How is is possible to convert fairseq gpt2 model to huggingface gpt2?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
myleottcommented, Dec 16, 2019

They have a script for converting RoBERTa checkpoints to the transformers library: https://github.com/huggingface/transformers/blob/master/transformers/convert_roberta_original_pytorch_checkpoint_to_pytorch.py

It’d be great to have something similar for language modeling. PRs welcome!

0reactions
stale[bot]commented, Apr 18, 2022

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting transformer-LM (GPT2) trained by fairseq to ...
Converting transformer-LM (GPT2) trained by fairseq to huggingface ... How is is possible to convert fairseq gpt2 model to huggingface gpt2?
Read more >
How can I convert a model created with fairseq? - Beginners
Hi, I fine tuned facebook's model mbart.cc25 for machine translation with Fairseq, it saved its model as checkpoint_*.pt. How can I use it ......
Read more >
Porting fairseq wmt19 translation system to transformers
Generate translation: take input numbers, run them through a pre-trained machine learning model which predicts the best translation, and return ...
Read more >
How to convert Fairseq model to huggingface transformer model
I want to deploy my model in huggingface. How can I convert fairseq model?. If it is possible how can I parse data...
Read more >
Source code for transformers.modeling_fsmt - Hugging Face
But if you want # to match fairseq outputs, you need to pass ... training=self.training) # Convert to FSMT output format: (seq_len, BS,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found