# \[Blenderbot\] Getting runtime error while using generate

**URL:** <https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127>\
**Category:** 🤗Transformers\
**Created:** [January 11, 2021, 10:35am UTC](https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127 "2021-01-11T10:35:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![parvej](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@parvej](https://discuss.huggingface.co/u/parvej)\
**Post date:** [January 11, 2021, 10:35am UTC](https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127/1 "2021-01-11T10:35:35Z")

</div>

While using blenderbot small model, I got a peculiar error saying–  
RuntimeError: probability tensor contains either `inf`, `nan` or element \< 0

I have been using generator function for many days, but never had this issue. Below is the code i used-

model = BlenderbotForConditionalGeneration.from\_pretrained(‘facebook/blenderbot-90M’)  
tokenizer = BlenderbotSmallTokenizer.from\_pretrained(‘facebook/blenderbot-90M’)  
outputs = model.generate(input\_ids=encoded, max\_length=20, do\_sample=True, temperature=1.5, top\_k=150, top\_p=0.99)

---

<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 11, 2021, 2:16pm UTC](https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127/2 "2021-01-11T14:16:58Z")

</div>

Hi @parvej , could you also post the input (the `encoded` variable in your snippet) that way we can reproduce it.

---

<div class="post-metadata">

**Author:** ![ffer](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@ffer](https://discuss.huggingface.co/u/ffer)\
**Post date:** [April 11, 2023, 12:59pm UTC](https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127/3 "2023-04-11T12:59:48Z")

</div>

Could you solve it? I’m facing the same issue.

---

<div class="post-metadata">

**Author:** ![saireddy](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@saireddy](https://discuss.huggingface.co/u/saireddy)\
**Post date:** [August 8, 2023, 11:55pm UTC](https://discuss.huggingface.co/t/blenderbot-getting-runtime-error-while-using-generate/3127/4 "2023-08-08T23:55:36Z")

</div>

facing same issue and waiting for solution
