KBaba7/llama.cpp
0
1import json, subprocess, sys, os2 3assert len(sys.argv) >= 24[_, pattern, *rest] = sys.argv5 6print(subprocess.check_output(7 [8 "python",9 os.path.join(10 os.path.dirname(os.path.realpath(__file__)),11 "json_schema_to_grammar.py"),12 *rest,13 "-",14 "--raw-pattern",15 ],16 text=True,17 input=json.dumps({18 "type": "string",19 "pattern": pattern,20 }, indent=2)))21 