Skip to content

Commit

Permalink
fix condition_on_previous_text
Browse files Browse the repository at this point in the history
prompt_reset_since is set before all_tokens is extended hence does not have the expected effect.
  • Loading branch information
funboarder13920 committed Apr 12, 2023
1 parent c09a7ae commit a248046
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ def new_segment(
)
seek += segment_size

if not condition_on_previous_text or result.temperature > 0.5:
# do not feed the prompt tokens if a high temperature was used
prompt_reset_since = len(all_tokens)

if word_timestamps:
add_word_timestamps(
segments=current_segments,
Expand Down Expand Up @@ -357,6 +353,10 @@ def new_segment(
[token for segment in current_segments for token in segment["tokens"]]
)

if not condition_on_previous_text or result.temperature > 0.5:
# do not feed the prompt tokens if a high temperature was used
prompt_reset_since = len(all_tokens)

# update progress bar
pbar.update(min(content_frames, seek) - previous_seek)

Expand Down

0 comments on commit a248046

Please sign in to comment.