Spaces:
Running
Running
ruby : ignore "Downloading" output in test_log_suppress (#3106)
Browse filesThis commit adds a temporary fix to the `test_log_suppress` test in the
Ruby bindings.
The motivation for this changes is that I suspect that the recent
migration of the models to HuggingFace Xet has changed the way HTTP
caching works for the models. This is causing the test in question to
fail. This is a temporary fix so that CI is not broken while we
investigate this further.
bindings/ruby/tests/test_whisper.rb
CHANGED
|
@@ -118,7 +118,18 @@ class TestWhisper < TestBase
|
|
| 118 |
dev = StringIO.new("")
|
| 119 |
$stderr = dev
|
| 120 |
Whisper::Context.new("base.en")
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
ensure
|
| 123 |
$stderr = stderr
|
| 124 |
end
|
|
|
|
| 118 |
dev = StringIO.new("")
|
| 119 |
$stderr = dev
|
| 120 |
Whisper::Context.new("base.en")
|
| 121 |
+
|
| 122 |
+
# Filter out any lines starting with "Downloading" or containing only dots.
|
| 123 |
+
# The reason for this is that I think the recent migration to Huggingface
|
| 124 |
+
# Xet might have changed the downloading behavior. There is now a redirect
|
| 125 |
+
# to a different URL, which causes the download to be retried even if the
|
| 126 |
+
# file is already downloaded.
|
| 127 |
+
# TODO(danbev) Remove this when a proper fix is in place.
|
| 128 |
+
filtered_output = dev.string.lines.reject do |line|
|
| 129 |
+
line.start_with?("Downloading") || line.strip =~ /^\.+$/
|
| 130 |
+
end.join
|
| 131 |
+
|
| 132 |
+
assert_empty filtered_output, "Expected no output, but got: #{filtered_output.inspect}"
|
| 133 |
ensure
|
| 134 |
$stderr = stderr
|
| 135 |
end
|