Skip to content

Commit 7745fcf

Browse files
authored
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
1 parent c09b0e0 commit 7745fcf

File tree

1 file changed

+1
-1
lines changed
  • bindings/ruby/lib/whisper/model

1 file changed

+1
-1
lines changed

bindings/ruby/lib/whisper/model/uri.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def download(response)
9494
end
9595

9696
def show_progress(current, size)
97-
progress_rate_available = size && $stderr.tty?
97+
progress_rate_available = size && $stderr.tty? && $stderr.winsize[1] >= line.size
9898

9999
unless @prev
100100
@prev = Time.now

0 commit comments

Comments
 (0)