MCPcopy Create free account
hub / github.com/ankane/tokenizers-ruby / test_id_token_conversion

Method test_id_token_conversion

test/tokenizer_test.rb:152–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 end
151
152 def test_id_token_conversion
153 tokenizer = Tokenizers.from_pretrained("bert-base-cased")
154 assert_equal 1169, tokenizer.token_to_id("can")
155 assert_equal "magic", tokenizer.id_to_token(3974)
156 end
157
158 def test_vocab_size
159 tokenizer = Tokenizers.from_pretrained("bert-base-cased")

Callers

nothing calls this directly

Calls 3

from_pretrainedMethod · 0.45
token_to_idMethod · 0.45
id_to_tokenMethod · 0.45

Tested by

no test coverage detected