3
$\begingroup$

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?

$\endgroup$

1 Answer 1

2
$\begingroup$

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")
$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$
    – sam
    Feb 20, 2022 at 16:54
  • $\begingroup$ 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. $\endgroup$
    – Oxbowerce
    Feb 20, 2022 at 19:30
  • $\begingroup$ thanks a lot but in general does bert better than LSTM or it depends on the size of data ? $\endgroup$
    – sam
    Feb 20, 2022 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.