rajpurkar/squad
Viewer • Updated • 98.2k • 144k • 367
How to use xichenn/albert-base-v2-squad-fp16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="xichenn/albert-base-v2-squad-fp16") # Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("xichenn/albert-base-v2-squad-fp16")
model = AutoModelForQuestionAnswering.from_pretrained("xichenn/albert-base-v2-squad-fp16")This model is a fp16 quantized version of albert-base-v2-squad. It achieves the following results on the SQuAD 1.1 evaluation set (no model accuracy loss compared to fp32):
You can test the model directly using the Hugging Face Inference API:
from transformers import pipeline
# Load the pipeline
qa_pipeline = pipeline("question-answering", model="xichenn/albert-base-v2-squad-fp16")
# Run inference
result = qa_pipeline(question="What is the capital of France?", context="France is a country in Europe. Its capital is Paris.")
print(result)
Base model
albert/albert-base-v2