3

how can I use BERT-tiny .. I tried to load bert-base-uncased by this line

transformers.AutoTokenizer.from_pretrained("bert-base-uncased")

but how can I use BERT-tiny, please?

sam
  • 35
  • 4

1 Answers1

2

You can use the bert-tiny model uploaded to the huggingface model repository by user prajjwal1. The model card mentions that it uses the checkpoint from the offical Google BERT repository and converted it to pytorch.

import transformers

transformers.AutoTokenizer.from_pretrained("prajjwal1/bert-tiny")

Oxbowerce
  • 7,472
  • 2
  • 8
  • 23
  • thanks a lot so if there is another model for BERT i should search for a user who uploads a tiny size of it ? or it is by default there is a tiny model for each BERT model – sam Feb 20 '22 at 16:54
  • This all depends on the model you are using, it's generally best to look at the description of the model to find out what it exactly is. – Oxbowerce Feb 20 '22 at 19:30
  • thanks a lot but in general does bert better than LSTM or it depends on the size of data ? – sam Feb 20 '22 at 21:04