Views
No views yet
1from transformers import pipeline
2qa_pipeline = pipeline(
3 "question-answering",
4 model = "ZTamas/hubert-qa-milqa-impossible-long-answer",
5 tokenizer = "ZTamas/hubert-qa-milqa-impossible-long-answer",
6 device = 0, #GPU selection, -1 on CPU
7 handle_impossible_answer = True,
8 max_answer_len = 1000 #This can be modified, but to let the model's
9 #answer be as long as it wants so I
10 #decided to add a big number
11 )
12
13predictions = qa_pipeline({
14 'context': context,
15 'question': question
16})
17
18print(predictions)
19