rajpurkar/squad
Viewer • Updated • 98.2k • 142k • 367
How to use RedHatAI/mobilebert-uncased-finetuned-squadv1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="RedHatAI/mobilebert-uncased-finetuned-squadv1") # Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("RedHatAI/mobilebert-uncased-finetuned-squadv1")
model = AutoModelForQuestionAnswering.from_pretrained("RedHatAI/mobilebert-uncased-finetuned-squadv1")This model is a finetuned version of the mobilebert-uncased model on the SQuADv1 task. To make this TPU-trained model stable when used in PyTorch on GPUs, the original model has been additionally pretrained for one epoch on BookCorpus and English Wikipedia with disabled dropout before finetuning on the SQuADv1 task.
It is produced as part of the work on the paper The Optimal BERT Surgeon: Scalable and Accurate Second-Order Pruning for Large Language Models.
SQuADv1 dev-set:
EM = 83.96
F1 = 90.90
Code: https://github.com/neuralmagic/sparseml/tree/main/research/optimal_BERT_surgeon_oBERT
If you find the model useful, please consider citing our work.
@article{kurtic2022optimal,
title={The Optimal BERT Surgeon: Scalable and Accurate Second-Order Pruning for Large Language Models},
author={Kurtic, Eldar and Campos, Daniel and Nguyen, Tuan and Frantar, Elias and Kurtz, Mark and Fineran, Benjamin and Goin, Michael and Alistarh, Dan},
journal={arXiv preprint arXiv:2203.07259},
year={2022}
}