Back to all models

Unable to determine this model’s pipeline type. Check the docs .

Monthly model downloads

google/mobilebert-uncased google/mobilebert-uncased
6,092 downloads
last 30 days

pytorch

tf

Contributed by

Google AI company
3 team members · 54 models

How to use this model directly from the 🤗/transformers library:

			
Copy to clipboard
from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("google/mobilebert-uncased") model = AutoModel.from_pretrained("google/mobilebert-uncased")

MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices

MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.

This checkpoint is the original MobileBert Optimized Uncased English: uncased_L-24_H-128_B-512_A-4_F-4_OPT checkpoint.

How to use MobileBERT in transformers

from transformers import pipeline

fill_mask = pipeline(
    "fill-mask",
    model="google/mobilebert-uncased",
    tokenizer="google/mobilebert-uncased"
)

print(
    fill_mask(f"HuggingFace is creating a {fill_mask.tokenizer.mask_token} that the community uses to solve NLP tasks.")
)