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)