mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-04-11 04:48:31 +02:00
* Don't generate documentation on test * Move .startup to TestBase class * Extract new_segment_callback as a function * Extract progress_callback as a function * Extract abort_callback as a function * Extract register_callbacks as a function * Call callbacks in Whiser::Context#full and #full_parallel * Fix README * Care about the cases content-size is nil and TTY is not available * Add tests for no_speech_prob * Add Whisper::Context#full_get_segment_no_speech_prob and Whisper::Segment#no_speech_prob
25 lines
492 B
Ruby
25 lines
492 B
Ruby
require "test/unit"
|
|
require "whisper"
|
|
require_relative "jfk_reader/jfk_reader"
|
|
|
|
class TestBase < Test::Unit::TestCase
|
|
AUDIO = File.join(__dir__, "..", "..", "..", "samples", "jfk.wav")
|
|
|
|
class << self
|
|
attr_reader :whisper
|
|
|
|
def startup
|
|
@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
|