@@ -36,7 +36,7 @@ public string? UnknownToken
3636
3737 if ( value is null )
3838 {
39- if ( VocabReverse . TryGetValue ( 0 , out string v ) )
39+ if ( VocabReverse . TryGetValue ( 0 , out string ? v ) )
4040 {
4141 VocabReverse . Remove ( 0 ) ;
4242 if ( Vocab . TryGetValue ( v , out int id ) )
@@ -103,7 +103,7 @@ public Bpe(string vocabFile, string? mergesFile, string? unknownToken = null, st
103103 VocabReverse . Add ( kvp . Value , kvp . Key ) ;
104104 }
105105
106- if ( unknownToken is null && VocabReverse . TryGetValue ( 0 , out string unkToken ) )
106+ if ( unknownToken is null && VocabReverse . TryGetValue ( 0 , out string ? unkToken ) )
107107 {
108108 unknownToken = unkToken ;
109109 }
@@ -187,7 +187,7 @@ public override IReadOnlyList<Token> Tokenize(string sequence)
187187 /// <returns>The mapped token of the Id.</returns>
188188 public override string ? IdToToken ( int id , bool skipSpecialTokens = false )
189189 {
190- if ( VocabReverse . TryGetValue ( id , out string value ) )
190+ if ( VocabReverse . TryGetValue ( id , out string ? value ) )
191191 {
192192 return value ;
193193 }
@@ -253,7 +253,7 @@ public override string[] Save(string path, string? prefix = null)
253253 }
254254
255255 /// Read the given files to extract the vocab and merges
256- internal static ( Dictionary < string , int > ? , Vec < ( string , string ) > ) ReadFile ( string ? vocab , string ? merges )
256+ internal static ( Dictionary < string , int > ? , Vec < ( string , string ) > ) ReadFile ( string vocab , string ? merges )
257257 {
258258 Dictionary < string , int > ? dic ;
259259 using ( Stream stream = File . OpenRead ( vocab ) )
@@ -320,7 +320,7 @@ internal static (Dictionary<string, int>?, Vec<(string, string)>) ReadFile(strin
320320 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
321321 internal string CharToString ( char c )
322322 {
323- if ( _charToString . TryGetValue ( c , out string v ) )
323+ if ( _charToString . TryGetValue ( c , out string ? v ) )
324324 {
325325 return v ;
326326 }
0 commit comments