Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding word level timestamps to CLI #913

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading