You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I training using llama-7b and math, I found that the sizes of left_pdding and intervention_locations did not match. This is because the tokenizer. bos_token_id=0 of llama-7b has multiple positions of 0 in input.
If we use the following formula in the project: left_ adding=(inputs ["input_ids"]=tokenizer. bos_token_id). nonzero (as_tuple=True) [1], then the size of left_ adding is (N), where N is the number of inputs ["input_ids"] that are 0, rather than the desired size: (batch_size).
Therefore, I have changed it to the following code:
Mask=(inputs ["input_ids"]==tokenizer. bos_token_id)
Indications=torch. top (mask. int()), k=1, dim=-1).indices
Left_pdding=torch. where (mask. any (dim=-1), indices. reshape (mask. shape [: -1]), -1)
I hope the author can verify whether it is due to other issues that caused my error or if I understand the reason; Is the revised code correct.
The text was updated successfully, but these errors were encountered:
When I training using llama-7b and math, I found that the sizes of left_pdding and intervention_locations did not match. This is because the tokenizer. bos_token_id=0 of llama-7b has multiple positions of 0 in input.
If we use the following formula in the project:
left_ adding=(inputs ["input_ids"]=tokenizer. bos_token_id). nonzero (as_tuple=True) [1]
, then the size of left_ adding is (N), where N is the number of inputs ["input_ids"] that are 0, rather than the desired size: (batch_size).Therefore, I have changed it to the following code:
I hope the author can verify whether it is due to other issues that caused my error or if I understand the reason; Is the revised code correct.
The text was updated successfully, but these errors were encountered: