11 references to TryGetValue
Microsoft.ML.Tokenizers (11)
Model\BPETokenizer.cs (6)
59
if (!_vocab.
TryGetValue
(value, out int id))
272
if (!_vocab.
TryGetValue
(mergeValues.a, out int aId))
277
if (!_vocab.
TryGetValue
(mergeValues.b, out int bId))
288
if (!_vocab.
TryGetValue
(newToken, out int newId))
950
if (!_vocab.
TryGetValue
(UnknownToken, out int value))
959
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)
62
if (!vocab!.
TryGetValue
(options.UnknownToken, out int id))