fix condition_on_previous_text (#1224)

prompt_reset_since is set before all_tokens is extended hence does not have the expected effect.
This commit is contained in:
Valentin Berkes 2023-05-05 09:31:35 +02:00 committed by GitHub
parent 7ca9fbea86
commit 248b6cb124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,10 +312,6 @@ def transcribe(
) )
seek += segment_size 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: if word_timestamps:
add_word_timestamps( add_word_timestamps(
segments=current_segments, segments=current_segments,
@ -361,6 +357,10 @@ def transcribe(
[token for segment in current_segments for token in segment["tokens"]] [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 # update progress bar
pbar.update(min(content_frames, seek) - previous_seek) pbar.update(min(content_frames, seek) - previous_seek)