Skip to content

Commit

Permalink
Rename clear_previous_text_on_temperature argument
Browse files Browse the repository at this point in the history
`prompt_reset_on_temperature` is more clear what it does.
  • Loading branch information
Purfview authored Aug 3, 2023
1 parent 1a1eb1a commit 71a0c7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TranscriptionOptions(NamedTuple):
no_speech_threshold: Optional[float]
compression_ratio_threshold: Optional[float]
condition_on_previous_text: bool
clear_previous_text_on_temperature: float
prompt_reset_on_temperature: float
temperatures: List[float]
initial_prompt: Optional[Union[str, Iterable[int]]]
prefix: Optional[str]
Expand Down Expand Up @@ -172,7 +172,7 @@ def transcribe(
log_prob_threshold: Optional[float] = -1.0,
no_speech_threshold: Optional[float] = 0.6,
condition_on_previous_text: bool = True,
clear_previous_text_on_temperature: float = 0.5,
prompt_reset_on_temperature: float = 0.5,
initial_prompt: Optional[Union[str, Iterable[int]]] = None,
prefix: Optional[str] = None,
suppress_blank: bool = True,
Expand Down Expand Up @@ -211,8 +211,8 @@ def transcribe(
as a prompt for the next window; disabling may make the text inconsistent across
windows, but the model becomes less prone to getting stuck in a failure loop,
such as repetition looping or timestamps going out of sync.
clear_previous_text_on_temperature: If the temperature is above this value,
clear the previous text.
prompt_reset_on_temperature: Resets prompt if temperature is above this value.
Arg has effect only if condition_on_previous_text is True.
initial_prompt: Optional text string or iterable of token ids to provide as a
prompt for the first window.
prefix: Optional text to provide as a prefix for the first window.
Expand Down Expand Up @@ -323,7 +323,7 @@ def transcribe(
no_speech_threshold=no_speech_threshold,
compression_ratio_threshold=compression_ratio_threshold,
condition_on_previous_text=condition_on_previous_text,
clear_previous_text_on_temperature=clear_previous_text_on_temperature,
prompt_reset_on_temperature=prompt_reset_on_temperature,
temperatures=(
temperature if isinstance(temperature, (list, tuple)) else [temperature]
),
Expand Down Expand Up @@ -566,7 +566,7 @@ def generate_segments(

if (
not options.condition_on_previous_text
or temperature > options.clear_previous_text_on_temperature
or temperature > options.prompt_reset_on_temperature
):
prompt_reset_since = len(all_tokens)

Expand Down

0 comments on commit 71a0c7c

Please sign in to comment.