Add repetition_penalty parameter to stream_builder function

This commit is contained in:
2024-07-11 21:45:38 +08:00
parent 4ed1c695fe
commit 931b578899

View File

@@ -120,6 +120,7 @@ def stream_builder(
vad_filter: bool,
language: str | None,
initial_prompt: str = "",
repetition_penalty: float = 1.0,
) -> Tuple[Iterable[Segment], TranscriptionInfo]:
segments, info = transcriber.model.transcribe(
audio=audio,
@@ -127,6 +128,7 @@ def stream_builder(
task=task,
initial_prompt=initial_prompt,
word_timestamps=True,
repetition_penalty=repetition_penalty,
)
print(
"Detected language '%s' with probability %f"