Unverified Commit 243b2ea3 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix `test_model_parallelism` for `FalconModel` (#24914)



* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent c0359702
......@@ -1040,7 +1040,7 @@ class FalconForSequenceClassification(FalconPreTrainedModel):
sequence_lengths = -1
else:
if input_ids is not None:
sequence_lengths = torch.ne(input_ids, self.config.pad_token_id).sum(dim=-1) - 1
sequence_lengths = (torch.ne(input_ids, self.config.pad_token_id).sum(dim=-1) - 1).to(logits.device)
else:
sequence_lengths = -1
logger.warning(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment