mirror of
https://github.com/shirayu/whispering.git
synced 2025-04-26 18:44:42 +00:00
Add debug log
This commit is contained in:
parent
b51d7c6cce
commit
56508bc282
1 changed files with 3 additions and 0 deletions
|
@ -150,8 +150,10 @@ class WhisperStreamingTranscriber:
|
||||||
if (
|
if (
|
||||||
len(consecutive) > 0
|
len(consecutive) > 0
|
||||||
): # if the output contains two consecutive timestamp tokens
|
): # if the output contains two consecutive timestamp tokens
|
||||||
|
logger.debug(f"Length of consecutive: {len(consecutive)}")
|
||||||
last_slice = 0
|
last_slice = 0
|
||||||
for current_slice in consecutive:
|
for current_slice in consecutive:
|
||||||
|
logger.debug(f" last_slice={last_slice}, current_slice={current_slice}")
|
||||||
sliced_tokens = tokens[last_slice:current_slice]
|
sliced_tokens = tokens[last_slice:current_slice]
|
||||||
start_timestamp_position = (
|
start_timestamp_position = (
|
||||||
sliced_tokens[0].item() - self.tokenizer.timestamp_begin
|
sliced_tokens[0].item() - self.tokenizer.timestamp_begin
|
||||||
|
@ -177,6 +179,7 @@ class WhisperStreamingTranscriber:
|
||||||
self.timestamp += last_timestamp_position0 * self.time_precision
|
self.timestamp += last_timestamp_position0 * self.time_precision
|
||||||
yield last_timestamp_position0
|
yield last_timestamp_position0
|
||||||
else:
|
else:
|
||||||
|
logger.debug("Length of consecutive: 0")
|
||||||
duration = segment_duration
|
duration = segment_duration
|
||||||
timestamps = tokens[timestamp_tokens.nonzero().flatten()]
|
timestamps = tokens[timestamp_tokens.nonzero().flatten()]
|
||||||
if len(timestamps) > 0:
|
if len(timestamps) > 0:
|
||||||
|
|
Loading…
Reference in a new issue