# Predicting answers using DistilBertForQuestionAnswering

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307%3E%5C
**Category:** Beginners\
**Created:** [January 20, 2021, 3:47pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307 "2021-01-20T15:47:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SathsaraRasantha](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SathsaraRasantha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSathsaraRasantha)%5C
**Post date:** [January 20, 2021, 3:47pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307%2F1 "2021-01-20T15:47:58Z")

</div>

I have fine-tuned DistilBertForQuestionAnswering model using custom data. And I saved that model in colab. I can load the model as well.

I need to know how I can use that loaded model to input a question and get a answer(prediction).

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvalhalla)%5C
**Post date:** [January 22, 2021, 7:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307%2F2 "2021-01-22T07:13:03Z")

</div>

You can find this info in the [docs](https://huggingface.co/transformers/task_summary.html#extractive-question-answering). Always nice to check docs before asking here 😉

---

<div class="post-metadata">

**Author:** ![SathsaraRasantha](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SathsaraRasantha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSathsaraRasantha)%5C
**Post date:** [January 22, 2021, 2:06pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307%2F3 "2021-01-22T14:06:58Z")

</div>

I tried the code in docs. But it gives me a error.

 ![Screenshot (217)](https://us1.discourse-cdn.com/hellohellohello/original/2X/5/52df0dbe77877464d66e771ca0e4489f170f3e6b.png)

RuntimeError: Input, output and indices must be on the current device

---

<div class="post-metadata">

**Author:** ![SathsaraRasantha](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SathsaraRasantha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSathsaraRasantha)%5C
**Post date:** [January 22, 2021, 2:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpredicting-answers-using-distilbertforquestionanswering%2F3307%2F4 "2021-01-22T14:37:49Z")

</div>

I solved that issue by putting inputs.to(device)

It ran fine for one time. But then it gives the error “RuntimeError: CUDA error: device-side assert triggered”. And it is pointing to where I put “inputs.to(device)”.
