[Minor] Improve code style (#2422)
This commit is contained in:
1 parent
0ce091a82d
commit
641b7d0ae0
15 files changed
+33
-21
No files matched your search
@@ -117,7 +117,10 @@ class XGrammarGrammarBackend(BaseGrammarBackend):
|
||||
key_type, key_string = key
|
||||
if key_type == "json":
|
||||
try:
|
||||
ctx = self.grammar_compiler.compile_json_schema(schema=key_string)
|
||||
if key_string == "$$ANY$$":
|
||||
ctx = self.grammar_compiler.compile_builtin_json_grammar()
|
||||
else:
|
||||
ctx = self.grammar_compiler.compile_json_schema(schema=key_string)
|
||||
except RuntimeError as e:
|
||||
logging.warning(
|
||||
f"Skip invalid json_schema: json_schema={key_string}, {e=}"
|
||||
|
||||
Reference in new issue
Block a user