ValueError: The following `model_kwargs` are not used by the model: ['encoder_outputs'] (note: typos in the generate arguments will also show up
When I try to run my  code for Donut for DocVQA model, I got the following error
&quot;&quot;&quot;Test&quot;&quot;&quot;
from donut import DonutModel
from PIL import Image
import torch

model = DonutModel.from_pretrained(
    &quot;naver-clova-ix/donut-base-finetuned-cord-v2&quot;)
if torch.cuda.is_available():
    model.half()
    device = torch.device(&quot;cuda&quot;)
    model.to(device)
else:
    model.encoder.to(torch.bfloat16)
model.eval()
image = Image.open(
    &quot;./src/png-report-page_capone_v1_August_2017_GMS_Balance_Sheet_0.png&quot;).convert(&quot;RGB&quot;)
output = model.inference(image=image, prompt=&quot;&lt;s_cord-v2&gt;&quot;)

print(output)

The error`
ValueError: The following `model_kwargs` are not used by the model: ['encoder_outputs'] (note: typos in the generate arguments will also show up in this list)


Check the transformers library version.
For me, I reinstalled the 4.21.3 version and it worked.
