<p dir="auto">Hi friends-<br>
I am trying to train a Roberta on a large corpus with a server with time limitation.<br>
Is there any way to save the model like every 3000 steps to keep record of the training, and resume it later?<br>
Really need it with the project…Thanks for helping.</p>
<p dir="auto">For QA task (extractive QA) the pipeline provides/returns 4 values.</p>
<ol dir="auto">
<li>a probability score</li>
<li>start index</li>
<li>end index</li>
<li>extracted answer<br>
(<a href="https://huggingface.co/transformers/main_classes/pipelines.html#transformers.QuestionAnsweringPipeline" rel="nofollow">https://huggingface.co/transformers/main_classes/pipelines.html#transformers.QuestionAnsweringPipeline</a>)</li>
</ol>
<p dir="auto">But If I am using the model class directly   (not using pipeline) like the code below then i am unable to find the probability score :</p>
<p dir="auto">`<br>
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)<br>
model = AutoModelForQuestionAnswering.from_pretrained(MODEL_NAME,return_dict=True)<br>
_encoding = tokenizer.encode_plus(question, docText, return_tensors="pt",max_length=4096)<br>
input_ids = encoding["input_ids"]<br>
attention_mask = encoding["attention_mask"]</p>
<p dir="auto">start_scores, end_scores = model(input_ids, attention_mask=attention_mask).values()<br>
all_tokens = tokenizer.convert_ids_to_tokens(input_ids[0].tolist())<br>
answer_tokens = all_tokens[torch.argmax(start_scores) :torch.argmax(end_scores)+1]<br>
answer = tokenizer.decode(tokenizer.convert_tokens_to_ids(answer_tokens))_<br>
`<br>
This answer object has only 3 values. extracted answer, start score and end score.I cant find any way or function to calculate the probability score. I want it because I want to sort multiple answers according to their probability/confidence score.</p>
<p dir="auto">This is a duplicate of Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="657315849" data-permission-text="Title is private" data-url="https://github.com/huggingface/transformers/issues/5768" data-hovercard-type="issue" data-hovercard-url="/huggingface/transformers/issues/5768/hovercard" href="https://github.com/huggingface/transformers/issues/5768">#5768</a> but that issue has been marked close without any answer.</p>