Display time taken to run whisperCallable.invoke()

#20
by FlippFuzz - opened

Just adding a timer around invoke()

Example:

Running whisper from  00:04.250  to  00:06.662 , duration:  2.412 expanded:  0 prompt:  None language:  None
 Thank you for watching!
Whisper took 5.392727698024828 seconds <--- This is the change.

Interesting, with this we can more easily see what I causing Whisper to spend more time on certain chunks:

image.png

There is a linear correlation with the duration of the chunk, but there's a bit of variation.

By the way, I imported this into Excel by converting the log using the following Regex:

Running\hwhisper\hfrom\h+(\d{2}:\d{2}\.\d{3})\h+to\h+(\d{2}:\d{2}\.\d{3})\h*,\h+duration:\h+(\d+\.\d+)\h+expanded:\h+(\d+\.\d+)\h+prompt:\h+(.+)\h+language:\h+(.+)\RWhisper\htook\h+(\d+\.\d+)\h+seconds

Replacing it with:

\1\t\2\t\3\t\4\t"\5"\t\6\t\7

Hm, though perhaps we ought to use a logging library here, so people can filter out these performance numbers if they are not interested. But I guess it's fine for now - so I'll just merge this. ๐Ÿ‘

aadnk changed pull request status to merged

Sign up or log in to comment