Skip to content

Commit 8bf0ba7

Browse files
committed
Add tests for no_speech_prob
1 parent 73e8207 commit 8bf0ba7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

bindings/ruby/tests/test_segment.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ def test_end_time
3232
end
3333
end
3434

35+
def test_no_speech_prob
36+
no_speech_prob = nil
37+
whisper.each_segment do |segment|
38+
no_speech_prob = segment.no_speech_prob
39+
end
40+
assert no_speech_prob > 0.0
41+
end
42+
3543
def test_on_new_segment
3644
params = Whisper::Params.new
3745
seg = nil

bindings/ruby/tests/test_whisper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def test_full_get_segment_speaker_turn_next
5555
def test_full_get_segment_text
5656
assert_match /ask not what your country can do for you, ask what you can do for your country/, whisper.full_get_segment_text(0)
5757
end
58+
59+
def test_full_get_segment_no_speech_prob
60+
prob = whisper.full_get_segment_no_speech_prob(0)
61+
assert prob > 0.0
62+
assert prob < 1.0
63+
end
5864
end
5965

6066
def test_lang_max_id

0 commit comments

Comments
 (0)