Views
No views yet
1from transformers import pipeline
2
3# Load the model
4question_answerer = pipeline(
5 "question-answering",
6 model="real-jiakai/my_awesome_qa_model",
7 tokenizer="real-jiakai/my_awesome_qa_model"
8)
9
10# English example
11context_en = """
12Donald Trump was the 45th president of the United States, serving from 2017 to 2021.
13"""
14
15question_en = "Who was the 45th president of the United States?"
16
17result_en = question_answerer(question=question_en, context=context_en)
18print("Answer:", result_en['answer'])@misc{my_awesome_qa_model,
author = {real-jiakai},
title = {my_awesome_qa_model},
year = {2024},
url = {https://huggingface.co/real-jiakai/my_awesome_qa_model},
publisher = {Hugging Face}
}