1 write to EndOfSentenceToken
Microsoft.ML.Tokenizers (1)
Model\CodeGenTokenizer.cs (1)
140
EndOfSentenceToken
= endOfSentenceToken;
17 references to EndOfSentenceToken
Microsoft.ML.Tokenizers (10)
Model\CodeGenTokenizer.cs (10)
166
if (!string.IsNullOrEmpty(
EndOfSentenceToken
))
168
if (!_vocab.TryGetValue(
EndOfSentenceToken
!, out (int endOfSentenceId, string token) value))
170
throw new ArgumentException($"The end of sentence token '{
EndOfSentenceToken
}' is not found in the vocabulary.");
181
if (AddEndOfSentence && string.IsNullOrEmpty(
EndOfSentenceToken
))
399
tokens.Add(new EncodedToken(EndOfSentenceId.Value,
EndOfSentenceToken
!, new Range(index, index)));
1272
AppendToBytesArray(
EndOfSentenceToken
!.AsSpan(), ref bytes, ref bytesIndex);
1399
if (
EndOfSentenceToken
!.Length > buffer.Length)
1404
EndOfSentenceToken
.AsSpan().CopyTo(buffer);
1405
buffer = buffer.Slice(
EndOfSentenceToken
.Length);
1406
charsWritten +=
EndOfSentenceToken
.Length;
Microsoft.ML.Tokenizers.Tests (7)
CodeGenTests.cs (7)
294
string targetText = $"{codeGenTokenizer.BeginningOfSentenceToken}{text}{codeGenTokenizer.
EndOfSentenceToken
}";
683
Assert.True(codeGenTokenizer.
EndOfSentenceToken
is not null);
688
tokensList.Add(codeGenTokenizer.
EndOfSentenceToken
!);
711
tokensList.Add(codeGenTokenizer.
EndOfSentenceToken
!);
823
tokensList.Add(codeGenTokenizer.
EndOfSentenceToken
!);
852
tokensList.Add(codeGenTokenizer.
EndOfSentenceToken
!);
979
Assert.Equal(DefaultSpecialToken, codeGenTokenizer.
EndOfSentenceToken
);