From bf2b92217f97efa6f1cade29b685e803221b3a67 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 26 Sep 2023 15:07:38 +0200 Subject: [PATCH] Apply suggestions from code review --- .../models/custom_modeling/idefics_vision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/text_generation_server/models/custom_modeling/idefics_vision.py b/server/text_generation_server/models/custom_modeling/idefics_vision.py index 0418281231e..30f07095e71 100644 --- a/server/text_generation_server/models/custom_modeling/idefics_vision.py +++ b/server/text_generation_server/models/custom_modeling/idefics_vision.py @@ -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]