Unverified Commit 5dfec704 authored by Manuel R. Ciosici's avatar Manuel R. Ciosici Committed by GitHub
Browse files

Remove duplicated line (#18310)

Removes a duplicated instantiation of device. I removed the second instance of the line to maintain code alignment with the GPT-J implementation of forward.
parent 47c2af09
...@@ -547,7 +547,6 @@ class GPTNeoModel(GPTNeoPreTrainedModel): ...@@ -547,7 +547,6 @@ class GPTNeoModel(GPTNeoPreTrainedModel):
else: else:
past_length = past_key_values[0][0].size(-2) past_length = past_key_values[0][0].size(-2)
device = input_ids.device if input_ids is not None else inputs_embeds.device
if position_ids is None: if position_ids is None:
position_ids = torch.arange(past_length, input_shape[-1] + past_length, dtype=torch.long, device=device) position_ids = torch.arange(past_length, input_shape[-1] + past_length, dtype=torch.long, device=device)
position_ids = position_ids.unsqueeze(0).view(-1, input_shape[-1]) position_ids = position_ids.unsqueeze(0).view(-1, input_shape[-1])
......
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