11 references to TryGetValue
Microsoft.ML.Tokenizers (11)
Model\BPETokenizer.cs (6)
59if (!_vocab.TryGetValue(value, out int id)) 257if (!_vocab.TryGetValue(mergeValues.a, out int aId)) 262if (!_vocab.TryGetValue(mergeValues.b, out int bId)) 273if (!_vocab.TryGetValue(newToken, out int newId)) 935if (!_vocab.TryGetValue(UnknownToken, out int value)) 944if (!_vocab.TryGetValue(UnknownToken, out int value))
Model\CodeGenTokenizer.cs (3)
148if (!_vocab.TryGetValue(UnknownToken!, out (int unknownId, string token) value)) 158if (!_vocab.TryGetValue(BeginningOfSentenceToken!, out (int beggingOfSentenceId, string token) value)) 168if (!_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)
67if (!vocab!.TryGetValue(unknownToken, out int id))