whispercpp.py icon indicating copy to clipboard operation
whispercpp.py copied to clipboard

get progress updates from python

Open denizsincar29 opened this issue 2 years ago • 2 comments

Hello! I trying to make a gui voice transcriber in python but i couldn't figure out how to get progress of recognition. Also, can I fix the small ggml model's spelling errors? Maybe with some apis... Thanks in advance.

denizsincar29 avatar Feb 24 '23 12:02 denizsincar29

This would probably be quite hard as the C++ components are printing the progress directly to stdout. One hacking solution could be to redirect stdout to a variable in Python and use regex to find the transcription progress. See: https://stackoverflow.com/questions/1218933/can-i-redirect-the-stdout-into-some-sort-of-string-buffer

This is probably a very poor solution as you would also have to periodically check the stdout in another thread as to not wait for the transcription to finish and it would also suppress all relevant information written to stdout.

mico-boje avatar Mar 07 '23 16:03 mico-boje

There is now a progress callback : https://github.com/ggerganov/whisper.cpp/blob/3c28d1a5712e4c06b0380166e6f482ca2b525970/whisper.h#L407

called here : https://github.com/ggerganov/whisper.cpp/blob/master/whisper.cpp#L5195-L5196

athoune avatar Dec 04 '23 19:12 athoune