mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-08-26 04:56:21 +02:00
Handle negative value in padding (#3389)
this might happen depending on the way the $stderr.winsize is defined. If the expression "$stderr.winsize[1] - line.size" in Line 114 gets negative, we will get a "negative argument" exception in the padding calculation
This commit is contained in:
@@ -94,7 +94,7 @@ module Whisper
|
||||
end
|
||||
|
||||
def show_progress(current, size)
|
||||
progress_rate_available = size && $stderr.tty?
|
||||
progress_rate_available = size && $stderr.tty? && $stderr.winsize[1] >= line.size
|
||||
|
||||
unless @prev
|
||||
@prev = Time.now
|
||||
|
Reference in New Issue
Block a user