Download whisper.cpp/bindings/ruby/test/helper.rb from Dyen/Rovin: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/spaces/Dyen/Rovin/resolve/main/whisper.cpp/bindings/ruby/test/helper.rb
- Command line
-
hf download hf://spaces/Dyen/Rovin/whisper.cpp/bindings/ruby/test/helper.rb
-
curl -L -o helper.rb https://huggingface.co/spaces/Dyen/Rovin/resolve/main/whisper.cpp/bindings/ruby/test/helper.rb
484 Bytes
| require "test/unit" | |
| require "whisper" | |
| require_relative "jfk_reader/jfk_reader" | |
| class TestBase < Test::Unit::TestCase | |
| AUDIO = File.join(__dir__, "fixtures", "jfk.wav") | |
| class << self | |
| def whisper | |
| return @whisper if @whisper | |
| @whisper = Whisper::Context.new("base.en") | |
| params = Whisper::Params.new | |
| params.print_timestamps = false | |
| @whisper.transcribe(TestBase::AUDIO, params) | |
| end | |
| end | |
| private | |
| def whisper | |
| self.class.whisper | |
| end | |
| end | |