Views
No views yet
1sentencepiece==0.1.97
2protobuf==3.20.01from transformers import pipeline
2qa_pipeline = pipeline(
3 "question-answering",
4 model = "ZTamas/xlm-roberta-large-squad2-qa-milqa-impossible",
5 tokenizer = "ZTamas/xlm-roberta-large-squad2-qa-milqa-impossible",
6 device = 0, #GPU selection, -1 on CPU
7 handle_impossible_answer = True,
8 max_answer_len = 50 #This can be modified
9 )
10
11predictions = qa_pipeline({
12 'context': context,
13 'question': question
14})
15
16print(predictions)
17