12 references to EncodeToIds
Microsoft.ML.Tokenizers (1)
Model\BertTokenizer.cs (1)
263IReadOnlyList<int> ids = text is null ? base.EncodeToIds(textSpan, considerPreTokenization, considerNormalization) : base.EncodeToIds(text, considerPreTokenization, considerNormalization);
Microsoft.ML.Tokenizers.Tests (11)
BpeTests.cs (1)
441Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
CodeGenTests.cs (4)
372Assert.Equal(ids, tokenizer.EncodeToIds(text.AsSpan())); 611ids = codeGenTokenizer.EncodeToIds(text.AsSpan()); 744ids = codeGenTokenizer.EncodeToIds(text.AsSpan()); 892ids = codeGenTokenizer.EncodeToIds(text.AsSpan());
EnglishRobertaTests.cs (1)
193Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
LlamaTests.cs (2)
342Assert.Equal([], llamaTokenizer.EncodeToIds(Span<char>.Empty)); 557Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
TiktokenTests.cs (1)
580Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
TokenizerTests.cs (2)
159prefixIds = tokenizer.EncodeToIds(prefixString.AsSpan(), considerNormalization: false); 177suffixIds = tokenizer.EncodeToIds(suffixString.AsSpan(), considerNormalization: false);