mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-08-12 22:31:22 +04: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