Spaces:
Configuration error
Configuration error
Fedir Zadniprovskyi
commited on
Commit
·
f268aa3
1
Parent(s):
93fae96
feat: support hotwords
Browse files
faster_whisper_server/main.py
CHANGED
@@ -247,6 +247,7 @@ def transcribe_file(
|
|
247 |
Form(alias="timestamp_granularities[]"),
|
248 |
] = ["segment"],
|
249 |
stream: Annotated[bool, Form()] = False,
|
|
|
250 |
) -> str | TranscriptionJsonResponse | TranscriptionVerboseJsonResponse | StreamingResponse:
|
251 |
whisper = load_model(model)
|
252 |
segments, transcription_info = whisper.transcribe(
|
@@ -257,6 +258,7 @@ def transcribe_file(
|
|
257 |
word_timestamps="word" in timestamp_granularities,
|
258 |
temperature=temperature,
|
259 |
vad_filter=True,
|
|
|
260 |
)
|
261 |
|
262 |
if stream:
|
|
|
247 |
Form(alias="timestamp_granularities[]"),
|
248 |
] = ["segment"],
|
249 |
stream: Annotated[bool, Form()] = False,
|
250 |
+
hotwords: Annotated[str | None, Form()] = None,
|
251 |
) -> str | TranscriptionJsonResponse | TranscriptionVerboseJsonResponse | StreamingResponse:
|
252 |
whisper = load_model(model)
|
253 |
segments, transcription_info = whisper.transcribe(
|
|
|
258 |
word_timestamps="word" in timestamp_granularities,
|
259 |
temperature=temperature,
|
260 |
vad_filter=True,
|
261 |
+
hotwords=hotwords,
|
262 |
)
|
263 |
|
264 |
if stream:
|