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)
70
ByteCodeToIdOffset
= _vocab.TryGetValue("<0x00>", out int id) ? id : MaxByteId;
217
ByteCodeToIdOffset
= _vocab.TryGetValue("<0x00>", out int id) ? id : MaxByteId;
23 references to ByteCodeToIdOffset
Microsoft.ML.Tokenizers (23)
Model\SentencePieceBaseModel.cs (10)
216
while (current <
ByteCodeToIdOffset
)
232
EncodeByte(current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, ref bytesPoolArray, ref sb);
249
if (current <
ByteCodeToIdOffset
)
273
bytesPoolArray![bytesCount++] = (byte)(current -
ByteCodeToIdOffset
);
277
EncodeByte(current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, ref bytesPoolArray, ref sb);
440
while (current <
ByteCodeToIdOffset
)
461
if (!EncodeByte(enumerator.Current, OneByteUtf8EncodingMaxId,
ByteCodeToIdOffset
, ref bytesCount, buffer, ref charsWritten, ref idsConsumed, ref bytesPoolArray))
515
if (current <
ByteCodeToIdOffset
)
546
bytesPoolArray![bytesCount++] = (byte)(current -
ByteCodeToIdOffset
);
550
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)
71
OneByteUtf8EncodingMaxId =
ByteCodeToIdOffset
+ 0x7F; // 0x7F is the maximum value of the one byte UTF-8 character.
72
MaxIdByteFallbackId =
ByteCodeToIdOffset
+ 0xFF; // from <0x00> to <0xFF>.
218
if (!_vocab.ContainsKey("<0x00>") || !_vocab.TryGetValue("<0xFF>", out int maxByteId) || maxByteId -
ByteCodeToIdOffset
!= 0xFF)
224
OneByteUtf8EncodingMaxId =
ByteCodeToIdOffset
+ 0x7F;
225
MaxIdByteFallbackId =
ByteCodeToIdOffset
+ 0xFF;
708
int id =
ByteCodeToIdOffset
+ destination[0];
713
id =
ByteCodeToIdOffset
+ destination[j];
1038
ids.Insert(IdsIndex,
ByteCodeToIdOffset
+ normalizationSpan[Utf8Index + j]);