Fedir Zadniprovskyi commited on
Commit
d9a6bd7
·
1 Parent(s): f3632d1

fix: timestamp_granularities remove plural form

Browse files
Files changed (1) hide show
  1. faster_whisper_server/main.py +3 -3
faster_whisper_server/main.py CHANGED
@@ -210,9 +210,9 @@ def transcribe_file(
210
  response_format: Annotated[ResponseFormat, Form()] = config.default_response_format,
211
  temperature: Annotated[float, Form()] = 0.0,
212
  timestamp_granularities: Annotated[
213
- list[Literal["segments"] | Literal["words"]],
214
  Form(alias="timestamp_granularities[]"),
215
- ] = ["segments"],
216
  stream: Annotated[bool, Form()] = False,
217
  ):
218
  start = time.perf_counter()
@@ -222,7 +222,7 @@ def transcribe_file(
222
  task="transcribe",
223
  language=language,
224
  initial_prompt=prompt,
225
- word_timestamps="words" in timestamp_granularities,
226
  temperature=temperature,
227
  vad_filter=True,
228
  )
 
210
  response_format: Annotated[ResponseFormat, Form()] = config.default_response_format,
211
  temperature: Annotated[float, Form()] = 0.0,
212
  timestamp_granularities: Annotated[
213
+ list[Literal["segment"] | Literal["word"]],
214
  Form(alias="timestamp_granularities[]"),
215
+ ] = ["segment"],
216
  stream: Annotated[bool, Form()] = False,
217
  ):
218
  start = time.perf_counter()
 
222
  task="transcribe",
223
  language=language,
224
  initial_prompt=prompt,
225
+ word_timestamps="word" in timestamp_granularities,
226
  temperature=temperature,
227
  vad_filter=True,
228
  )