Thanks! I'll merge this first and move those magic strings as a global variable somewhere in #869.
I expected so, and of course there's more of it where that came from ;-)
def transcribe(
model: "Whisper",
audio: Union[str, np.ndarray, torch.Tensor],
*,
verbose: Optional[bool] = None,
temperature: Union[float, Tuple[float, ...]] = (0.0, 0.2, 0.4, 0.6, 0.8, 1.0),
compression_ratio_threshold: Optional[float] = 2.4,
logprob_threshold: Optional[float] = -1.0,
no_speech_threshold: Optional[float] = 0.6,
condition_on_previous_text: bool = True,
initial_prompt: Optional[str] = None,
word_timestamps: bool = False,
prepend_punctuations: str = "\"\'“¿([{-",
append_punctuations: str = "\"\'.。,,!!??::”)]}、",
**decode_options,
):
One of these magic values actually doesn't match up with the default parameter values in cli()
:
def cli():
...
parser.add_argument("--temperature", type=float, default=0, help="temperature to use for sampling")
So when used from the command line, the temperature will default to 0, and via transcribe()
the temperature will default to (0.0, 0.2, 0.4, 0.6, 0.8, 1.0)
.
Login to write a write a comment.
Allows the
prepend_punctuations
andappend_punctuations
options to be set from the CLI or from a python program that callstranscribe()
.