Skip to content

Commit

Permalink
Adding word level timestamps to CLI (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus authored Sep 28, 2024
1 parent b592550 commit 7f1fd31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion buzz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def parse(app: Application, parser: QCommandLineParser):
"",
)
initial_prompt_option = QCommandLineOption(
["p", "prompt"], "Initial prompt", "prompt", ""
["p", "prompt"], "Initial prompt.", "prompt", ""
)
word_timestamp_option = QCommandLineOption(
["wt", "word-timestamps"], "Generate word-level timestamps."
)
open_ai_access_token_option = QCommandLineOption(
"openai-token",
Expand All @@ -115,6 +118,7 @@ def parse(app: Application, parser: QCommandLineParser):
hugging_face_model_id_option,
language_option,
initial_prompt_option,
word_timestamp_option,
open_ai_access_token_option,
output_directory_option,
srt_option,
Expand Down Expand Up @@ -167,6 +171,8 @@ def parse(app: Application, parser: QCommandLineParser):

initial_prompt = parser.value(initial_prompt_option)

word_timestamps = parser.isSet(word_timestamp_option)

output_formats: typing.Set[OutputFormat] = set()
if parser.isSet(srt_option):
output_formats.add(OutputFormat.SRT)
Expand All @@ -192,6 +198,7 @@ def parse(app: Application, parser: QCommandLineParser):
task=task,
language=language,
initial_prompt=initial_prompt,
word_level_timings=word_timestamps,
openai_access_token=openai_access_token,
)
file_transcription_options = FileTranscriptionOptions(
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ Options:
(Urdu), uz (Uzbek), vi (Vietnamese), yi
(Yiddish), yo (Yoruba), zh (Chinese). Leave
empty to detect language.
-p, --prompt <prompt> Initial prompt
-p, --prompt <prompt> Initial prompt.
-wt, --word-timestamps Generate word-level timestamps.
--openai-token <token> OpenAI access token. Use only when
--model-type is openaiapi. Defaults to your
previously saved access token, if one exists.
Expand Down

0 comments on commit 7f1fd31

Please sign in to comment.