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

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127%3E%5C
**Category:** 🤗Transformers\
**Created:** [January 11, 2021, 10:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fparvej)%5C
**Post date:** [January 11, 2021, 10:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvalhalla)%5C
**Post date:** [January 11, 2021, 2:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fffer)%5C
**Post date:** [April 11, 2023, 12:59pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsaireddy)%5C
**Post date:** [August 8, 2023, 11:55pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fblenderbot-getting-runtime-error-while-using-generate%2F3127%2F4 "2023-08-08T23:55:36Z")

</div>

facing same issue and waiting for solution
