@@ -42,7 +42,7 @@ def construct_compiled_grammar():
4242
4343def test_get_serialization_version ():
4444 """Test the version of the serialized JSON string."""
45- assert xgr .get_serialization_version () == "v5 "
45+ assert xgr .get_serialization_version () == "v6 "
4646
4747
4848def test_serialize_grammar ():
@@ -61,7 +61,7 @@ def test_serialize_grammar():
6161 "complete_fsm" : None ,
6262 "per_rule_fsms" : [],
6363 "allow_empty_rule_ids" : [],
64- "__VERSION__" : "v5 " ,
64+ "__VERSION__" : "v6 " ,
6565 }
6666 # The fsms are the same one, but the start state and end states are different.
6767 assert json .loads (serialized ) == expected_json
@@ -81,14 +81,14 @@ def test_serialize_grammar_exception():
8181 "allow_empty_rule_ids" : [],
8282 "complete_fsm" : None ,
8383 "per_rule_fsms" : [],
84- "__VERSION__" : "v5 " ,
84+ "__VERSION__" : "v6 " ,
8585 }
8686
8787 expected_json ["__VERSION__" ] = "v1" # Change version to trigger error
8888 with pytest .raises (xgr .DeserializeVersionError ):
8989 xgr .Grammar .deserialize_json (json .dumps (expected_json ))
9090
91- expected_json ["__VERSION__" ] = "v5 "
91+ expected_json ["__VERSION__" ] = "v6 "
9292 expected_json .pop ("rules" ) # Remove required field to trigger error
9393 with pytest .raises (xgr .DeserializeFormatError ):
9494 xgr .Grammar .deserialize_json (json .dumps (expected_json ))
@@ -140,7 +140,7 @@ def test_serialize_tokenizer_info():
140140 '"decoded_vocab":["1","212","a","A","b","\\ u00e4\\ u00b8\\ u0080","-","aBc","abc"],'
141141 '"sorted_decoded_vocab":[[6,"-"],[3,"A"],[2,"a"],[7,"aBc"],[8,"abc"],[4,"b"],[5,"\\ u00e4\\ u00b8\\ u0080"]],'
142142 '"trie_subtree_nodes_range":[1,2,5,4,5,6,7],'
143- '"__VERSION__":"v5 "}'
143+ '"__VERSION__":"v6 "}'
144144 )
145145 assert json .loads (serialized ) == json .loads (expected_json )
146146
@@ -221,7 +221,7 @@ def test_serialize_compiled_grammar():
221221 "add_prefix_space" : True ,
222222 "stop_token_ids" : [0 , 1 ],
223223 },
224- "__VERSION__" : "v5 " ,
224+ "__VERSION__" : "v6 " ,
225225 }
226226
227227 class AdaptiveTokenMask (BaseModel ):
0 commit comments