11 references to TryGetValue
Microsoft.ML.Tokenizers (11)
Model\BPETokenizer.cs (6)
59
if (!_vocab.
TryGetValue
(value, out int id))
257
if (!_vocab.
TryGetValue
(mergeValues.a, out int aId))
262
if (!_vocab.
TryGetValue
(mergeValues.b, out int bId))
273
if (!_vocab.
TryGetValue
(newToken, out int newId))
935
if (!_vocab.
TryGetValue
(UnknownToken, out int value))
944
if (!_vocab.
TryGetValue
(UnknownToken, out int value))
Model\CodeGenTokenizer.cs (3)
148
if (!_vocab.
TryGetValue
(UnknownToken!, out (int unknownId, string token) value))
158
if (!_vocab.
TryGetValue
(BeginningOfSentenceToken!, out (int beggingOfSentenceId, string token) value))
168
if (!_vocab.
TryGetValue
(EndOfSentenceToken!, out (int endOfSentenceId, string token) value))
Model\SentencePieceTokenizer.cs (1)
60
_byteCodeToIdOffset = _vocab.
TryGetValue
("<0x00>", out (int Id, float Score, byte Type) value) ? value.Id : _maxByteId;
Model\WordPieceTokenizer.cs (1)
67
if (!vocab!.
TryGetValue
(unknownToken, out int id))