Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil authored Sep 26, 2023
1 parent 1053e5d commit bf2b922
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, prefix, config, weights):
self.position_embedding = TensorParallelEmbedding(
prefix="model.vision_model.embeddings.position_embedding", weights=weights
)
self.position_ids = torch.arange(self.num_positions).expand((1, -1))
self.position_ids = torch.arange(self.num_positions).expand((1, -1)).to(device=weights.device)

def forward(self, pixel_values: torch.FloatTensor) -> torch.Tensor:
batch_size = pixel_values.shape[0]
Expand Down

0 comments on commit bf2b922

Please sign in to comment.