Skip to content

Commit 70bbb89

Browse files
ruff
1 parent 4f15b88 commit 70bbb89

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/models/lightonocr/test_modeling_lightonocr.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ def prepare_config_and_inputs_for_common(self):
159159
attention_mask = input_ids.ne(self.pad_token_id)
160160

161161
# Create image_sizes as tensor - must match batch size
162-
image_sizes = torch.tensor(
163-
[[self.image_size, self.image_size]] * self.batch_size, dtype=torch.long
164-
)
162+
image_sizes = torch.tensor([[self.image_size, self.image_size]] * self.batch_size, dtype=torch.long)
165163

166164
inputs_dict = {
167165
"pixel_values": pixel_values,
@@ -201,9 +199,7 @@ def prepare_config_and_inputs_for_generate(self, batch_size=None):
201199
attention_mask = input_ids.ne(self.pad_token_id)
202200

203201
# Create image_sizes as tensor - must match batch size
204-
image_sizes = torch.tensor(
205-
[[self.image_size, self.image_size]] * batch_size, dtype=torch.long
206-
)
202+
image_sizes = torch.tensor([[self.image_size, self.image_size]] * batch_size, dtype=torch.long)
207203

208204
inputs_dict = {
209205
"pixel_values": pixel_values,

0 commit comments

Comments
 (0)