[Bugfix] V1: fix allowed_token_ids_mask aliasing in InputBatch.swap_states (#48419)
Signed-off-by: Rui Zhu <rui.zhu.rz399@yale.edu> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -688,12 +688,8 @@ class InputBatch:
|
||||
swap_dict_values(self.bad_words_token_ids, i1, i2)
|
||||
|
||||
if self.allowed_token_ids_mask_cpu_tensor is not None:
|
||||
(
|
||||
self.allowed_token_ids_mask_cpu_tensor[i1],
|
||||
self.allowed_token_ids_mask_cpu_tensor[i2],
|
||||
) = (
|
||||
self.allowed_token_ids_mask_cpu_tensor[i2],
|
||||
self.allowed_token_ids_mask_cpu_tensor[i1],
|
||||
self.allowed_token_ids_mask_cpu_tensor[[i1, i2]] = (
|
||||
self.allowed_token_ids_mask_cpu_tensor[[i2, i1]]
|
||||
)
|
||||
|
||||
def _get_active_token_count(self, req_index: int) -> int:
|
||||
|
||||
Reference in New Issue
Block a user