Add repetition_penalty parameter to stream_builder function
This commit is contained in:
@@ -120,6 +120,7 @@ def stream_builder(
|
|||||||
vad_filter: bool,
|
vad_filter: bool,
|
||||||
language: str | None,
|
language: str | None,
|
||||||
initial_prompt: str = "",
|
initial_prompt: str = "",
|
||||||
|
repetition_penalty: float = 1.0,
|
||||||
) -> Tuple[Iterable[Segment], TranscriptionInfo]:
|
) -> Tuple[Iterable[Segment], TranscriptionInfo]:
|
||||||
segments, info = transcriber.model.transcribe(
|
segments, info = transcriber.model.transcribe(
|
||||||
audio=audio,
|
audio=audio,
|
||||||
@@ -127,6 +128,7 @@ def stream_builder(
|
|||||||
task=task,
|
task=task,
|
||||||
initial_prompt=initial_prompt,
|
initial_prompt=initial_prompt,
|
||||||
word_timestamps=True,
|
word_timestamps=True,
|
||||||
|
repetition_penalty=repetition_penalty,
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
"Detected language '%s' with probability %f"
|
"Detected language '%s' with probability %f"
|
||||||
|
|||||||
Reference in New Issue
Block a user