# Predicting answers using DistilBertForQuestionAnswering

**URL:** <https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307>\
**Category:** Beginners\
**Created:** [January 20, 2021, 3:47pm UTC](https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307 "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](https://discuss.huggingface.co/u/SathsaraRasantha)\
**Post date:** [January 20, 2021, 3:47pm UTC](https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307/1 "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](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [January 22, 2021, 7:13am UTC](https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307/2 "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](https://discuss.huggingface.co/u/SathsaraRasantha)\
**Post date:** [January 22, 2021, 2:06pm UTC](https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307/3 "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](https://discuss.huggingface.co/u/SathsaraRasantha)\
**Post date:** [January 22, 2021, 2:37pm UTC](https://discuss.huggingface.co/t/predicting-answers-using-distilbertforquestionanswering/3307/4 "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)”.
