From e0833da5dc7132006310761f7e166e120f516da3 Mon Sep 17 00:00:00 2001 From: Howard Date: Thu, 15 May 2025 14:30:55 +0800 Subject: [PATCH] Fix: Ensure integer tensor indexing in get_wildcard_emission() --- whisperx/alignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisperx/alignment.py b/whisperx/alignment.py index b77a7f1..34fbbbb 100644 --- a/whisperx/alignment.py +++ b/whisperx/alignment.py @@ -424,7 +424,7 @@ def get_wildcard_emission(frame_emission, tokens, blank_id): wildcard_mask = (tokens == -1) # Get scores for non-wildcard positions - regular_scores = frame_emission[tokens.clamp(min=0)] # clamp to avoid -1 index + regular_scores = frame_emission[tokens.clamp(min=0).long()] # clamp to avoid -1 index # Create a mask and compute the maximum value without modifying frame_emission max_valid_score = frame_emission.clone() # Create a copy