Skip to content

Commit e55ac25

Browse files
committed
Add tests for Whisper::Model
1 parent 673e33a commit e55ac25

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

bindings/ruby/tests/test_model.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require_relative "helper"
2+
3+
class TestModel < TestBase
4+
def test_model
5+
whisper = Whisper::Context.new(MODEL)
6+
assert_instance_of Whisper::Model, whisper.model
7+
end
8+
9+
def test_attributes
10+
whisper = Whisper::Context.new(MODEL)
11+
model = whisper.model
12+
13+
assert_equal 51864, model.n_vocab
14+
assert_equal 1500, model.n_audio_ctx
15+
assert_equal 512, model.n_audio_state
16+
assert_equal 8, model.n_audio_head
17+
assert_equal 6, model.n_audio_layer
18+
assert_equal 448, model.n_text_ctx
19+
assert_equal 512, model.n_text_state
20+
assert_equal 8, model.n_text_head
21+
assert_equal 6, model.n_text_layer
22+
assert_equal 80, model.n_mels
23+
assert_equal 1, model.ftype
24+
assert_equal "base", model.type
25+
end
26+
end

0 commit comments

Comments
 (0)