

feat: support hotwords
#19
@79d949cf938e6743e08bb5d83f08c2fa0fc87815
--- faster_whisper_server/main.py
+++ faster_whisper_server/main.py
... | ... | @@ -247,6 +247,7 @@ |
247 | 247 |
Form(alias="timestamp_granularities[]"), |
248 | 248 |
] = ["segment"], |
249 | 249 |
stream: Annotated[bool, Form()] = False, |
250 |
+ hotwords: Annotated[str | None, Form()] = None, |
|
250 | 251 |
) -> str | TranscriptionJsonResponse | TranscriptionVerboseJsonResponse | StreamingResponse: |
251 | 252 |
whisper = load_model(model) |
252 | 253 |
segments, transcription_info = whisper.transcribe( |
... | ... | @@ -257,6 +258,7 @@ |
257 | 258 |
word_timestamps="word" in timestamp_granularities, |
258 | 259 |
temperature=temperature, |
259 | 260 |
vad_filter=True, |
261 |
+ hotwords=hotwords, |
|
260 | 262 |
) |
261 | 263 |
|
262 | 264 |
if stream: |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?