RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

#2
by treehugg3 - opened

The example fails on transformers-4.51.1:

Traceback (most recent call last):                                                                                                          
  File "./pixtral-4bit-test.py", line 24, in <module>                             
    generate_ids = model.generate(**inputs, max_new_tokens=512)
...
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

I'm encountering the same problem. Were you able to fix this?

Downgrading to transformers-4.48.3 helps, but not a real fix

Sign up or log in to comment