Skip to content

Commit

Permalink
feat: support hotwords
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedir Zadniprovskyi committed Jul 3, 2024
1 parent a4bb723 commit 28a7c7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions faster_whisper_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def transcribe_file(
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(
Expand All @@ -257,6 +258,7 @@ def transcribe_file(
word_timestamps="word" in timestamp_granularities,
temperature=temperature,
vad_filter=True,
hotwords=hotwords,
)

if stream:
Expand Down

0 comments on commit 28a7c7a

Please sign in to comment.