34 references to CountTokens
Microsoft.ML.Tokenizers.Tests (34)
BpeTests.cs (3)
265
Assert.Equal(ids.Length, tokenizer.
CountTokens
(sentence));
381
Assert.Equal(12, tokenizer.
CountTokens
(text));
457
Assert.Equal(expectedIds.Length, tokenizer.
CountTokens
(text));
CodeGenTests.cs (4)
428
Assert.Equal(ids.Length, codeGenTokenizer.
CountTokens
(text));
629
count = codeGenTokenizer.
CountTokens
(text);
762
count = codeGenTokenizer.
CountTokens
(text);
917
count = codeGenTokenizer.
CountTokens
(text);
EnglishRobertaTests.cs (4)
209
Assert.Equal(expectedIds.Length, tokenizer.
CountTokens
(text));
251
idsCount = tokenizer.
CountTokens
((string)p[0]);
257
idsCount = tokenizer.
CountTokens
((string)p[0]);
261
idsCount = tokenizer.
CountTokens
((string)p[0]);
LlamaTests.cs (4)
251
Assert.Equal(ids.Length, llamaTokenizer.
CountTokens
(input));
344
Assert.Equal(0, llamaTokenizer.
CountTokens
((string)null!));
632
Assert.Equal(expectedIds.Length, tokenizer.
CountTokens
(text));
672
tokenCount = tokenizer.
CountTokens
(kvp.Key);
TiktokenTests.cs (14)
144
int idsCount = tokenizer.
CountTokens
(text);
197
int idsCount = GPT4.
CountTokens
(text);
215
int idsCount = gpt4Tokenizer.
CountTokens
(text);
244
int idsCount = GPT4.
CountTokens
(text);
259
int idsCount = GPT4.
CountTokens
(text);
269
int idsCount = GPT4.
CountTokens
(text);
286
int idsCount = GPT4o.
CountTokens
(text);
303
idsCount = GPT4o.
CountTokens
(text);
323
int idsCount = GPT2.
CountTokens
(text);
342
int idsCount = P50kBase.
CountTokens
(text);
361
int idsCount = P50kEdit.
CountTokens
(text);
380
int idsCount = R50kBase.
CountTokens
(text);
596
Assert.Equal(expectedIds.Length, tokenizer.
CountTokens
(text));
690
Assert.Equal(expectedIds.Length, GPT4.
CountTokens
(text));
TokenizerTests.cs (3)
48
Assert.Equal(5, tokenizer.
CountTokens
("hello"));
200
Assert.Equal(0, tokenizer.
CountTokens
(s.Substring(index1)));
208
Assert.Equal(0, tokenizer.
CountTokens
(s.Substring(0, index2)));
WordPieceTests.cs (2)
64
Assert.Equal(0, tokenizer.
CountTokens
(""));
117
Assert.Equal(5, tokenizer.
CountTokens
(text));