File size: 491 Bytes
296a125 d58ba2c |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
transformers==4.20.1 torch==1.12.0 pandas==1.4.2 git clone https://huggingface.co/google-bert/bert-base-uncased # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased") model = AutoModelForMaskedLM.from_pretrained("google-bert/bert-base-uncased") # Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="google-bert/bert-base-uncased") |