mirror of
https://github.com/shirayu/whispering.git
synced 2025-02-08 14:52:21 +00:00
Fix (openai/whisper@2b0c297)
This commit is contained in:
parent
1989e023a5
commit
95dafe6740
1 changed files with 4 additions and 1 deletions
|
@ -203,7 +203,10 @@ class WhisperStreamingTranscriber:
|
||||||
duration = segment_duration
|
duration = segment_duration
|
||||||
timestamps = tokens[timestamp_tokens.nonzero().flatten()]
|
timestamps = tokens[timestamp_tokens.nonzero().flatten()]
|
||||||
logger.debug(f"Length of consecutive: 0, timestamps: {timestamps}")
|
logger.debug(f"Length of consecutive: 0, timestamps: {timestamps}")
|
||||||
if len(timestamps) > 0:
|
if (
|
||||||
|
len(timestamps) > 0
|
||||||
|
and timestamps[-1].item() != self.tokenizer.timestamp_begin
|
||||||
|
):
|
||||||
# no consecutive timestamps but it has a timestamp; use the last one.
|
# no consecutive timestamps but it has a timestamp; use the last one.
|
||||||
# single timestamp at the end means no speech after the last timestamp.
|
# single timestamp at the end means no speech after the last timestamp.
|
||||||
last_timestamp_position = (
|
last_timestamp_position = (
|
||||||
|
|
Loading…
Reference in a new issue