From d15bf312f5e5f950727efb6018396ec52068afe3 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 1 May 2025 19:38:46 +0900 Subject: [PATCH 1/3] Use cache file when model host doesn't support if-modified-since --- bindings/ruby/lib/whisper/model/uri.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/ruby/lib/whisper/model/uri.rb b/bindings/ruby/lib/whisper/model/uri.rb index 47c23c52721..06e7a263570 100644 --- a/bindings/ruby/lib/whisper/model/uri.rb +++ b/bindings/ruby/lib/whisper/model/uri.rb @@ -55,6 +55,8 @@ def request(uri, headers) when Net::HTTPNotModified # noop when Net::HTTPOK + return if !response.key?("last-modified") && cache_path.exist? + download response when Net::HTTPRedirection request URI(response["location"]), headers From 0fcc583fd21f0e121b12bb29b0216c48cf370d67 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 1 May 2025 19:39:04 +0900 Subject: [PATCH 2/3] Update gem date --- bindings/ruby/whispercpp.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/ruby/whispercpp.gemspec b/bindings/ruby/whispercpp.gemspec index 97cf4e27a12..9e9c424b913 100644 --- a/bindings/ruby/whispercpp.gemspec +++ b/bindings/ruby/whispercpp.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |s| s.name = "whispercpp" s.authors = ["Georgi Gerganov", "Todd A. Fisher"] s.version = '1.3.2' - s.date = '2025-04-25' + s.date = '2025-05-01' s.description = %q{High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model via Ruby} s.email = 'todd.fisher@gmail.com' s.extra_rdoc_files = ['LICENSE', 'README.md'] From e6a381acd2b035a9ef8899dd085e65c649ee39a2 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 1 May 2025 19:46:13 +0900 Subject: [PATCH 3/3] Revert "ruby : ignore "Downloading" output in test_log_suppress (#3106)" This reverts commit edbd4cb7f526897b48bf396e6cf3fccc3d74b378. --- bindings/ruby/tests/test_whisper.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bindings/ruby/tests/test_whisper.rb b/bindings/ruby/tests/test_whisper.rb index dfc4e0e0831..2754ab069e5 100644 --- a/bindings/ruby/tests/test_whisper.rb +++ b/bindings/ruby/tests/test_whisper.rb @@ -118,18 +118,7 @@ def test_log_suppress dev = StringIO.new("") $stderr = dev Whisper::Context.new("base.en") - - # Filter out any lines starting with "Downloading" or containing only dots. - # The reason for this is that I think the recent migration to Huggingface - # Xet might have changed the downloading behavior. There is now a redirect - # to a different URL, which causes the download to be retried even if the - # file is already downloaded. - # TODO(danbev) Remove this when a proper fix is in place. - filtered_output = dev.string.lines.reject do |line| - line.start_with?("Downloading") || line.strip =~ /^\.+$/ - end.join - - assert_empty filtered_output, "Expected no output, but got: #{filtered_output.inspect}" + assert_empty dev.string ensure $stderr = stderr end