Skip to content

Commit 8a2d663

Browse files
committed
Add test to make Whisper::Context.new accept URI
1 parent 7917c07 commit 8a2d663

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

bindings/ruby/tests/test_model.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,23 @@ def test_uri_string
8787
assert_equal 1, model.ftype
8888
assert_equal "base", model.type
8989
end
90+
91+
def test_uri
92+
path = URI("https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin")
93+
whisper = Whisper::Context.new(path)
94+
model = whisper.model
95+
96+
assert_equal 51864, model.n_vocab
97+
assert_equal 1500, model.n_audio_ctx
98+
assert_equal 512, model.n_audio_state
99+
assert_equal 8, model.n_audio_head
100+
assert_equal 6, model.n_audio_layer
101+
assert_equal 448, model.n_text_ctx
102+
assert_equal 512, model.n_text_state
103+
assert_equal 8, model.n_text_head
104+
assert_equal 6, model.n_text_layer
105+
assert_equal 80, model.n_mels
106+
assert_equal 1, model.ftype
107+
assert_equal "base", model.type
108+
end
90109
end

0 commit comments

Comments
 (0)