1 write to Value
Microsoft.ML.Tokenizers (1)
EncodedToken.cs (1)
40
Value
= value;
73 references to Value
Microsoft.ML.Tokenizers (13)
EncodedToken.cs (2)
44
public bool Equals(EncodedToken other) => Id == other.Id &&
Value
== other.
Value
&& Offset.Equals(other.Offset);
Model\CodeGenTokenizer.cs (3)
1596
tokens.Add(new EncodedToken(tokensToAdd[0].Id, tokensToAdd[0].
Value
, new Range(r.s, r.e)));
1600
tokens.Add(new EncodedToken(tokensToAdd[i].Id, tokensToAdd[i].
Value
, new Range(tokensToAdd[i].Offset.Start.Value + offset - 1, tokensToAdd[i].Offset.End.Value + offset - 1)));
1608
tokens.Add(new EncodedToken(t.Id, t.
Value
, new Range(t.Offset.Start.Value + offset, t.Offset.End.Value + offset)));
Model\EnglishRobertaTokenizer.cs (7)
339
tokens.Add(new EncodedToken(t.Id, t.
Value
, new Range(split.Offset + t.Offset.Start.Value, split.Offset + t.Offset.End.Value)));
917
Debug.Assert(index + tokens[i].
Value
.Length <= indexMapping.Length);
919
if (tokens[i].Offset.Start.Value != indexMapping[index] || tokens[i].Offset.End.Value != indexMapping[index] + tokens[i].
Value
.Length)
929
list.Add(new EncodedToken(tokens[j].Id, tokens[j].
Value
, new Range(indexMapping[index], indexMapping[index] + tokens[j].
Value
.Length)));
930
index += tokens[j].
Value
.Length;
936
index += tokens[i].
Value
.Length;
Model\WordPieceTokenizer.cs (1)
359
if (curToken.
Value
is null)
Microsoft.ML.Tokenizers.Tests (56)
BpeTests.cs (5)
276
Assert.Equal(expectedTokens[i], encoding[i].
Value
);
280
Assert.Equal(encoding[i].
Value
, reverseVocabulary[encodingIds[i]]);
281
Assert.Equal(encodingIds[i], bpe.Vocabulary[encoding[i].
Value
]);
432
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
436
Assert.Equal(expectedTokens, encoding1.Select(t => t.
Value
).ToArray());
CodeGenTests.cs (32)
237
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
243
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
557
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
562
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
567
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
572
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
581
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
586
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
591
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
596
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
601
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
606
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
690
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
695
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
700
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
705
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
714
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
719
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
724
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
729
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
734
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
739
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
825
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
831
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
837
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
843
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
855
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
861
Assert.Equal(tokensList, encoding.Select(t => t.
Value
).ToArray());
867
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
873
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
879
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
885
Assert.Equal(expectedTokensWithSpace, encoding.Select(t => t.
Value
).ToArray());
EnglishRobertaTests.cs (3)
184
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
188
Assert.Equal(expectedTokens, encoding1.Select(t => t.
Value
).ToArray());
268
string[] tokens = encoding.Select(t => t.
Value
).ToArray();
LlamaTests.cs (8)
246
Assert.Equal(tokens, result.Select(t => t.
Value
).ToArray());
268
Assert.Equal(tokens.Skip(1), bpeTokens.Select(token => token.
Value
));
278
Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Skip(1).Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.
Value
));
288
Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.
Value
));
503
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
507
Assert.Equal(expectedTokens, encoding1.Select(t => t.
Value
).ToArray());
541
Assert.Equal(expectedTokens1, encoding.Select(t => t.
Value
).ToArray());
665
Assert.Equal(new[] { tokenizer.BeginningOfSentenceToken, kvp.Key }, encodedTokens.Select(et => et.
Value
).ToArray());
TiktokenTests.cs (8)
147
string[] tokens = result.Select(token => token.
Value
).ToArray();
200
string[] tokens = result.Select(token => token.
Value
).ToArray();
241
string[] tokens = result.Select(token => token.
Value
).ToArray();
277
Assert.Equal(new string[] { "<|im_start|>", "Hello", " ⭐", "⭐", " World", "<|im_end|>" }, result.Select(token => token.
Value
).ToArray());
312
Assert.Equal(new string[] { "<|endoftext|>", "Hello", " ⭐", " World", "<|endofprompt|>" }, result.Select(token => token.
Value
).ToArray());
571
Assert.Equal(expectedTokens, encoding.Select(t => t.
Value
).ToArray());
575
Assert.Equal(expectedTokens, encoding1.Select(t => t.
Value
).ToArray());
686
Assert.Equal(expectedTokens, result.Select(r => r.
Value
));
Microsoft.ML.TorchSharp (4)
NasBert\NerTrainer.cs (3)
179
if (NerTrainer.TokenStartsWithSpace(encoding[i].
Value
))
389
if (NerTrainer.TokenStartsWithSpace(encoding[i].
Value
))
403
if (NerTrainer.TokenStartsWithSpace(encoding[i].
Value
))
Roberta\QATrainer.cs (1)
405
var contextToken = contextTokens.Select(t => t.
Value
).ToArray();