wietsedv / bertje

BERTje is a Dutch pre-trained BERT model developed at the University of Groningen. (EMNLP Findings 2020) "What’s so special about BERT’s layers? A closer look at the NLP pipeline in monolingual and multilingual models"
https://aclanthology.org/2020.findings-emnlp.389/
Apache License 2.0
135 stars 10 forks source link

Example with newest transformers version #12

Closed arnov closed 4 years ago

arnov commented 4 years ago

I am not too familiar with the intricacies of Transformers, but it seems the example in the README is outdated.

I did manage to load the model using this:

from transformers import AutoTokenizer, TFAutoModel

tokenizer = AutoTokenizer.from_pretrained("wietsedv/bert-base-dutch-cased")
model = TFAutoModel.from_pretrained("wietsedv/bert-base-dutch-cased")

Where I believe the TFAutoModel, is specific to the Tensorflow backend.

wietsedv commented 4 years ago

I wouldn't say that the readme is outdated because BertModel is still a regularly supported method. However, this only works if you have installed PyTorch. I updated the readme.

arnov commented 4 years ago

I do see the import now doesn't match the code in the README, is that correct?

wietsedv commented 4 years ago

That was correct. Fixed it.