This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the model | |
from transformers import AutoTokenizer, AutoModelForQuestionAnswering | |
import torch | |
tokenizer = AutoTokenizer.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad") | |
model = AutoModelForQuestionAnswering.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad") | |
## EXPAND POSITION EMBEDDINGS TO 1024 TOKENS | |
max_length = 1024 | |
tokenizer.model_max_length = max_length |