# Is Google's official BERT model and huggingface BERT model different or same?

**URL:** <https://discuss.huggingface.co/t/is-googles-official-bert-model-and-huggingface-bert-model-different-or-same/15529>\
**Category:** Beginners\
**Created:** [March 9, 2022, 5:53am UTC](https://discuss.huggingface.co/t/is-googles-official-bert-model-and-huggingface-bert-model-different-or-same/15529 "2022-03-09T05:53:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manirai91](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@manirai91](https://discuss.huggingface.co/u/manirai91)\
**Post date:** [March 9, 2022, 5:53am UTC](https://discuss.huggingface.co/t/is-googles-official-bert-model-and-huggingface-bert-model-different-or-same/15529/1 "2022-03-09T05:53:50Z")

</div>

[Google’s Official BERT](https://github.com/google-research/bert)  
[HuggingFace BERT](https://huggingface.co/bert-base-cased)

If they are same/equivalent, how are they created?

- Are the pretrained parameters just copied?
- Or are they pretrained from scratch following exact same approach (objective/hyperparameters) and data mention in the paper?

I have been searching for this information for hours, but can’t find anywhere.

---

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](https://discuss.huggingface.co/u/BramVanroy)\
**Post date:** [March 9, 2022, 7:38am UTC](https://discuss.huggingface.co/t/is-googles-official-bert-model-and-huggingface-bert-model-different-or-same/15529/2 "2022-03-09T07:38:27Z")

</div>

They have the same parameters. As you said the parameters are copied/converted. You’ll find that the repository contains a lot of conversion scripts, to convert between PyTorch and Tensorflow. For instance this one: [transformers/convert\_bert\_original\_tf2\_checkpoint\_to\_pytorch.py at cd56f3fe7eae4a53a9880e3f5e8f91877a78271c · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/blob/cd56f3fe7eae4a53a9880e3f5e8f91877a78271c/src/transformers/models/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py)

You’ll find more such scripts here: [Search · convert pytorch tensorflow · GitHub](https://github.com/huggingface/transformers/search?q=convert+pytorch+tensorflow)
