Spaces:
Build error
Build error
Download llama.cpp/common/json-schema-to-grammar.h from YZ-TAN/flask-llama: direct link, hf CLI and curl.
- Browser
- Download file 804 Bytes
-
https://huggingface.co/spaces/YZ-TAN/flask-llama/resolve/5a292634f6a0d0358b4ea9a6e2ca2bcc779f3785/llama.cpp/common/json-schema-to-grammar.h
- Command line
-
hf download hf://spaces/YZ-TAN/flask-llama@5a292634f6a0d0358b4ea9a6e2ca2bcc779f3785/llama.cpp/common/json-schema-to-grammar.h
-
curl -L -o json-schema-to-grammar.h https://huggingface.co/spaces/YZ-TAN/flask-llama/resolve/5a292634f6a0d0358b4ea9a6e2ca2bcc779f3785/llama.cpp/common/json-schema-to-grammar.h
804 Bytes
| // Change JSON_ASSERT from assert() to GGML_ASSERT: | |
| std::string json_schema_to_grammar(const nlohmann::ordered_json & schema, | |
| bool force_gbnf = false); | |
| struct common_grammar_builder { | |
| std::function<std::string(const std::string &, const std::string &)> add_rule; | |
| std::function<std::string(const std::string &, const nlohmann::ordered_json &)> add_schema; | |
| std::function<void(nlohmann::ordered_json &)> resolve_refs; | |
| }; | |
| struct common_grammar_options { | |
| bool dotall = false; | |
| bool compact_spaces = false; | |
| }; | |
| std::string build_grammar(const std::function<void(const common_grammar_builder &)> & cb, const common_grammar_options & options = {}); | |