mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
Fix: Ensure integer tensor indexing in get_wildcard_emission()
This commit is contained in:
@ -424,7 +424,7 @@ def get_wildcard_emission(frame_emission, tokens, blank_id):
|
|||||||
wildcard_mask = (tokens == -1)
|
wildcard_mask = (tokens == -1)
|
||||||
|
|
||||||
# Get scores for non-wildcard positions
|
# 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
|
# Create a mask and compute the maximum value without modifying frame_emission
|
||||||
max_valid_score = frame_emission.clone() # Create a copy
|
max_valid_score = frame_emission.clone() # Create a copy
|
||||||
|
Reference in New Issue
Block a user