From e8ae8bf9c504422e703243cd419d2d35896f0bd5 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Thu, 11 Jul 2024 21:48:46 +0800 Subject: [PATCH] Add repetition_penalty parameter to transcription endpoint --- whisper_fastapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/whisper_fastapi.py b/whisper_fastapi.py index 90eaf8f..4f6db2e 100644 --- a/whisper_fastapi.py +++ b/whisper_fastapi.py @@ -297,6 +297,7 @@ async def transcription( task: str = Form("transcribe"), language: str = Form("und"), vad_filter: bool = Form(False), + repetition_penalty: float = Form(1.0), ): """Transcription endpoint @@ -309,6 +310,7 @@ async def transcription( task=task, vad_filter=vad_filter, language=None if language == "und" else language, + repetition_penalty=repetition_penalty, ) # special function for streaming response (OpenAI API does not have this)