1 write to EndOfSentenceToken
Microsoft.ML.Tokenizers (1)
Model\SentencePieceTokenizer.cs (1)
65EndOfSentenceToken = modelProto.TrainerSpec.EosPiece ?? "</s>";
12 references to EndOfSentenceToken
Microsoft.ML.Tokenizers (4)
Model\SentencePieceTokenizer.cs (4)
303tokens.Add(new EncodedToken(EndOfSentenceId, EndOfSentenceToken, new Range(text.Length, text.Length))); 368tokens.Add(new EncodedToken(EndOfSentenceId, EndOfSentenceToken, new Range(text.Length, text.Length))); 1752sb.Append(tokenizer.EndOfSentenceToken); 1993specialToken = tokenizer.EndOfSentenceToken;
Microsoft.ML.Tokenizers.Tests (8)
LlamaTests.cs (8)
278Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Skip(1).Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 288Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 368Assert.Equal("</s>", bpe.EndOfSentenceToken); 386Assert.Equal(llamaTokenizer.EndOfSentenceToken, llamaTokenizer.Decode([llamaTokenizer.EndOfSentenceId], considerSpecialTokens: true)); 387Span<char> destinationBuffer = stackalloc char[llamaTokenizer.EndOfSentenceToken.Length]; 389Assert.Equal(llamaTokenizer.EndOfSentenceToken.Length, charactersWritten); 390Assert.Equal(llamaTokenizer.EndOfSentenceToken, destinationBuffer.ToString()); 533expectedTokens1 = addEndOfSentence ? expectedTokens1.Concat(new[] { sentencePieceBpe.EndOfSentenceToken }).ToArray() : expectedTokens1;