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