From 1c995b807fd963c25f65c127a7d591a0a3c72000 Mon Sep 17 00:00:00 2001 From: Matt Le Date: Tue, 30 Dec 2025 12:23:10 -0800 Subject: [PATCH] Place anchors on same device as audio When doing span prediction, we may create new anchor ids/alignment. We nened to place these tensors on the same device as `self.audios` in case the user has already moved the batch to device --- sam_audio/processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sam_audio/processor.py b/sam_audio/processor.py index a85a1974..79356445 100644 --- a/sam_audio/processor.py +++ b/sam_audio/processor.py @@ -119,8 +119,8 @@ def process_anchors(self, anchors: Optional[list[list[Anchor]]]): anchor_ids = pad_sequence( ids, batch_first=True, padding_value=anchor_dict[""] ) - self.anchor_ids = anchor_ids - self.anchor_alignment = anchor_alignment + self.anchor_ids = anchor_ids.to(self.audios.device) + self.anchor_alignment = anchor_alignment.to(self.audios.device) self.anchors = anchors