-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Whisper-stream: Add --pausable
/ -p
— live **Pause / Resume** control
#3325
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to work when I tested it (using Ubuntu). Pausing seems to work but not resuming.
examples/stream/stream.cpp
Outdated
@@ -112,6 +116,7 @@ void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & para | |||
fprintf(stderr, " -sa, --save-audio [%-7s] save the recorded audio to a file\n", params.save_audio ? "true" : "false"); | |||
fprintf(stderr, " -ng, --no-gpu [%-7s] disable GPU inference\n", params.use_gpu ? "false" : "true"); | |||
fprintf(stderr, " -fa, --flash-attn [%-7s] flash attention during inference\n", params.flash_attn ? "true" : "false"); | |||
fprintf(stderr, " --pausable [%-7s] allow stdin commands p,n (PAUSE)/(RESUME)\n", params.pausable ? "true" : "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the short option -p
is missing here.
And should this be r
and not n
:
fprintf(stderr, " --pausable [%-7s] allow stdin commands p,n (PAUSE)/(RESUME)\n", params.pausable ? "true" : "false"); | |
fprintf(stderr, " --pausable [%-7s] allow stdin commands p,r (PAUSE)/(RESUME)\n", params.pausable ? "true" : "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
continue; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before exit the control_thread should probably join the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joined
✨ Add
--pausable
/-p
— live Pause / Resume controlOverview
Enabling
--pausable
lets you temporarily suspend and resume real-time transcription without restarting the program.p
followed by a newline (p\n
)r
followed by a newline (r\n
)Why it matters
Implementation details
--pausable
(-p
), default off (backward-compatible).stdin
forp\n
/r\n
; unknown commands print a warning and are ignored.