bert icon indicating copy to clipboard operation
bert copied to clipboard

PyTorch implementation

Open VictorSanh opened this issue 8 years ago • 2 comments

Hello all,

We have released a PyTorch implementation/port of BERT !

Our scripts load Google's pre-trained models and it performs about the same as the TF implementation in our tests (see the readme). We have also included gradient-accumulation, multi-GPU & distributed training options to help you fine-tune these large models.

Here's the link: https://github.com/huggingface/pytorch-pretrained-BERT

We hope it will be useful !

Victor - HuggingFace 🤗

VictorSanh avatar Nov 05 '18 15:11 VictorSanh

Thanks! This is really awesome! I'll add a link to it in the FAQ.

I just made a change to tokenization.py to support Chinese, but this is the last change to modeling.py, tokenization.py, or optimziation.py that I plan to make. So if you port that change then it should also work with the new multilingual models.

jacobdevlin-google avatar Nov 05 '18 17:11 jacobdevlin-google

@jacobdevlin-google Another PyTorch port is now available:

https://github.com/innodatalabs/tbert

Features:

  • usable as a Python library, published on pypi: pip install tbert
  • Provides converter to load Google pre-trained checkpoints
  • Unit tests prove it behaves exactly as the original, continuous testing via Travis
  • Requires Python 3.6 or better

Please add a link to the FAQ

Thanks, -Mike

mkroutikov avatar Nov 10 '18 11:11 mkroutikov