3 writes to ByteCodeToIdOffset
Microsoft.ML.Tokenizers (3)
Model\SentencePieceBpeModel.cs (1)
40
ByteCodeToIdOffset
= _vocab.TryGetValue("<0x00>", out (int Id, float Score, byte Type) value) ? value.Id : MaxByteId;
Model\SentencePieceUnigramModel.cs (2)
75
ByteCodeToIdOffset
= _vocab.TryGetValue("<0x00>", out int id) ? id : MaxByteId;
237
ByteCodeToIdOffset
= _vocab.TryGetValue("<0x00>", out int id) ? id : MaxByteId;
23 references to ByteCodeToIdOffset
Microsoft.ML.Tokenizers (23)
Model\SentencePieceBaseModel.cs (10)
218
while (current <
ByteCodeToIdOffset
)
234
EncodeByte(current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, ref bytesPoolArray, ref sb);
251
if (current <
ByteCodeToIdOffset
)
275
bytesPoolArray![bytesCount++] = (byte)(current -
ByteCodeToIdOffset
);
279
EncodeByte(current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, ref bytesPoolArray, ref sb);
446
while (current <
ByteCodeToIdOffset
)
467
if (!EncodeByte(enumerator.Current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, buffer, ref charsWritten, ref idsConsumed, ref bytesPoolArray))
521
if (current <
ByteCodeToIdOffset
)
552
bytesPoolArray![bytesCount++] = (byte)(current -
ByteCodeToIdOffset
);
556
if (!EncodeByte(current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, buffer, ref charsWritten, ref idsConsumed, ref bytesPoolArray))
Model\SentencePieceBpeModel.cs (5)
41
OneByteUtf8EncodingMaxId =
ByteCodeToIdOffset
+ 0x7F; // 0x7F is the maximum value of the one byte UTF-8 character.
216
int id = (int)c +
ByteCodeToIdOffset
; // byte code is mapped to the to the Ids starting from 4.
240
int id = (int)utf8Bytes[j] +
ByteCodeToIdOffset
; // byte code is mapped to the to the Ids starting from 4.
515
accumulatedIds.Add((int)c +
ByteCodeToIdOffset
); // byte code is mapped to the to the Ids starting from 4.
543
accumulatedIds.Add((int)utf8Bytes[j] +
ByteCodeToIdOffset
); // byte code is mapped to the to the Ids starting from 4.
Model\SentencePieceUnigramModel.cs (8)
76
OneByteUtf8EncodingMaxId =
ByteCodeToIdOffset
+ 0x7F; // 0x7F is the maximum value of the one byte UTF-8 character.
77
MaxIdByteFallbackId =
ByteCodeToIdOffset
+ 0xFF; // from <0x00> to <0xFF>.
238
if (!_vocab.ContainsKey("<0x00>") || !_vocab.TryGetValue("<0xFF>", out int maxByteId) || maxByteId -
ByteCodeToIdOffset
!= 0xFF)
244
OneByteUtf8EncodingMaxId =
ByteCodeToIdOffset
+ 0x7F;
245
MaxIdByteFallbackId =
ByteCodeToIdOffset
+ 0xFF;
731
int id =
ByteCodeToIdOffset
+ destination[0];
736
id =
ByteCodeToIdOffset
+ destination[j];
1061
ids.Insert(IdsIndex,
ByteCodeToIdOffset
+ normalizationSpan[Utf8Index + j]);