echodict/llama.cpp
version https://git-lfs.github.com/spec/v1 oid sha256:cfc44b7ba25614df70e6b65e3341cae0310163bd32fd31a6b928a542df433faf size 30786
0765
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 