RuntimeError: Subtraction

#2
by yusuke1997 - opened

Hi, I tried to fine-tune using huggingface trainer, but I got following error message

  File "(My_Cache_File_Path)/modeling_chatglm.py", line 691, in get_masks
    full_attention_mask -= padding_mask.unsqueeze(-1) - 1
RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.

transformers==4.34.0
torch==2.1.0

Sign up or log in to comment