From 03b2c402d9d9ffc4c54443284b9b1cb9dd6db104 Mon Sep 17 00:00:00 2001 From: aravindMahadevan <15685389+aravindMahadevan@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:32:30 -0400 Subject: [PATCH] Update tokenizers.js --- src/tokenizers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tokenizers.js b/src/tokenizers.js index 19bad87cc..ada58a8fe 100644 --- a/src/tokenizers.js +++ b/src/tokenizers.js @@ -3613,8 +3613,8 @@ export class WhisperTokenizer extends PreTrainedTokenizer { // Whisper timestamp tokens start from 0.00 and go to timestamp 30.00 in 0.02 increments. // We can calculate the last time stamp token as timestamp_begin plus the number of tokens // tokens from 0.00 to 30.00 which is 1500. - const total_timestamp_tokens = (30.00 - 0.00) / 0.02 - const timestamp_end = timestamp_begin + total_timestamp_tokens + const total_timestamp_tokens = (30.00 - 0.00) / 0.02; + const timestamp_end = timestamp_begin + total_timestamp_tokens; let previous_tokens = []; let previous_token_timestamps = [];