Skip to content

Commit 0c59dfc

Browse files
committed
fix
1 parent 8b3fbbe commit 0c59dfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightllm/models/qwen2_vl/infer_struct.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def init_some_extra_state(self, model, input_ids: torch.Tensor):
1515
self.max_seq_len = b_seq_len_numpy.max()
1616
b_ready_cache_len_numpy = self.b_ready_cache_len.cpu().numpy()
1717
position_ids = torch.from_numpy(
18-
np.concatenate([np.arange(b_ready_cache_len_numpy[i], b_seq_len_numpy[i]) for i in range(len(b_seq_len_numpy))])
18+
np.concatenate(
19+
[np.arange(b_ready_cache_len_numpy[i], b_seq_len_numpy[i]) for i in range(len(b_seq_len_numpy))]
20+
)
1921
).cuda()
2022
self.position_sin = model._sin_cached[:, position_ids, :].unsqueeze(1)
2123
self.position_cos = model._cos_cached[:, position_ids, :].unsqueeze(1)

0 commit comments

Comments
 (0)