Fedir Zadniprovskyi 2024-07-03
feat: support hotwords
#19
@79d949cf938e6743e08bb5d83f08c2fa0fc87815
faster_whisper_server/main.py
--- faster_whisper_server/main.py
+++ faster_whisper_server/main.py
@@ -247,6 +247,7 @@
         Form(alias="timestamp_granularities[]"),
     ] = ["segment"],
     stream: Annotated[bool, Form()] = False,
+    hotwords: Annotated[str | None, Form()] = None,
 ) -> str | TranscriptionJsonResponse | TranscriptionVerboseJsonResponse | StreamingResponse:
     whisper = load_model(model)
     segments, transcription_info = whisper.transcribe(
@@ -257,6 +258,7 @@
         word_timestamps="word" in timestamp_granularities,
         temperature=temperature,
         vad_filter=True,
+        hotwords=hotwords,
     )
 
     if stream:
Add a comment
List