BERT model conversion from DeepPavlov to HuggingFace format

71 views Asked by At

I have a folder with the ruBERT model, which was fine-tuned with the application of the Deeppavlov library.

The folder contains the following model files:

enter image description here

How do I convert it to Huggingface format so that I can load it this way?

from transformers import TFAutoModelForSequenceClassification

model_name = "folder_with_ruBERT"
auto_model_rubert = TFAutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, do_lower_case = False)
1

There are 1 answers

3
com On BEST ANSWER

There is no need to convert the tf checkpoints into huggingface format. The DeepPavlov's pretrained language models are already available as huggingface models.

https://huggingface.co/DeepPavlov