namisan / mt-dnn

Multi-Task Deep Neural Networks for Natural Language Understanding
MIT License
2.23k stars 411 forks source link

How to convert pytorch_model.bin to .pt so that I can fine tune it with your code? #219

Closed junwang4 closed 2 years ago

junwang4 commented 3 years ago

For example, I need to use the pretrained BioBERT model from https://huggingface.co/dmis-lab/biobert-base-cased-v1.2/tree/main. It has 3 files: pytorch_model.bin, vocab.txt, config.json. How should I convert it to your .pt model? Thanks!

namisan commented 2 years ago

The format is similar to: https://github.com/namisan/mt-dnn/blob/master/scripts/strip_model.py I've updated the transformer package. You can just update related files to the pretrained models of interest, e.g., https://github.com/namisan/mt-dnn/blob/master/pretrained_models.py