diff --git a/src/Microsoft.ML.Tokenizers/Model/BpeOptions.cs b/src/Microsoft.ML.Tokenizers/Model/BpeOptions.cs index 8eee50ac66..1e276435fe 100644 --- a/src/Microsoft.ML.Tokenizers/Model/BpeOptions.cs +++ b/src/Microsoft.ML.Tokenizers/Model/BpeOptions.cs @@ -143,6 +143,14 @@ public BpeOptions(string vocabFile, string? mergesFile = null) /// if true, the input text will be converted to UTF-8 bytes before encoding it. /// Additionally, some ASCII characters will be transformed to different characters (e.g Space character will be transformed to 'Ġ' character). /// + /// + /// When this property is set to and no pre-tokenizer is specified, the tokenizer falls + /// back to PreTokenizer.CreateWordOrNonWord, whose pattern does not cover whitespace characters. As + /// only the segments returned by the pre-tokenizer are encoded, whitespace is not preserved during + /// pre-tokenization and cannot be recovered by decoding. + /// To keep whitespace, set to a pre-tokenizer whose pattern covers it, for example + /// a built from the GPT-2 pattern. + /// public bool ByteLevel { get; set; } ///