2 writes to _cache
Microsoft.ML.Tokenizers (2)
Model\TiktokenTokenizer.cs (2)
96
_cache
= new LruCache<(int Id, int TokenIndex, int TokenLength)[]>(cacheSize);
106
_cache
= new LruCache<(int Id, int TokenIndex, int TokenLength)[]>(cacheSize);
10 references to _cache
Microsoft.ML.Tokenizers (10)
Model\TiktokenTokenizer.cs (10)
136
Debug.Assert(
_cache
is not null);
144
_cache
!.Add(specialToken.Key, new[] { (Id: specialToken.Value, TokenIndex0: 0, TokenLength: specialToken.Key.Length) });
303
if (
_cache
.TryGetValue(text, out (int Id, int TokenIndex, int TokenLength)[] value))
343
_cache
.Add(textAsString, encodedTokens);
428
if (
_cache
.TryGetValue(text, out (int Id, int TokenIndex, int TokenLength)[] value))
458
_cache
.Add(textAsString, encodedTokens);
594
if (
_cache
.TryGetValue(text, out (int Id, int TokenIndex, int TokenLength)[] value))
623
_cache
.Add(textAsString, encodedTokens);
720
if (
_cache
.TryGetValue(text, out (int Id, int TokenIndex, int TokenLength)[] value))
749
_cache
.Add(textAsString, encodedTokens);