llama.cpp/examples
Ray Xu 8d880ac012
examples : fix empty items in json_schema_to_grammar.py [no ci] (#19968)
* Fix logic for retrieving schema items in `json_schema_to_grammar.py`

If `schema['items']` is `{}` and `prefixItems not in schema', as `{}` is Falsy, the original code here will raise an error.

I think if `schema['items']` is `{}`, them items should just be `{}`

* Apply suggestion from @CISC

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Add tests for arrays with empty items

Add two unit tests to `tests/test-json-schema-to-grammar.cpp` that validate handling of arrays when 'items' is an empty schema and when 'prefixItems' is present alongside an empty 'items'. Both tests expect the same generated grammar, ensuring the JSON Schema->grammar conversion treats an empty 'items' schema (and the presence of 'prefixItems') correctly and covering this edge case.

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
2026-03-10 14:38:18 +01:00
..
batched Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
batched.swift examples : remove references to `make` in examples [no ci] (#15457) 2025-08-21 06:12:28 +02:00
convert-llama2c-to-ggml Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
debug chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
deprecation-warning Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
diffusion chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
embedding Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
eval-callback Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
gen-docs Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
gguf Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
gguf-hash Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
idle metal : add residency sets keep-alive heartbeat (#17766) 2025-12-05 19:38:54 +02:00
llama.android refactor : remove libcurl, use OpenSSL when available (#18828) 2026-01-14 18:02:47 +01:00
llama.swiftui llama : deprecate llama_kv_self_ API (#14030) 2025-06-06 14:11:15 +03:00
lookahead Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
lookup Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
model-conversion chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
parallel Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
passkey Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
retrieval Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
save-load-state Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
simple Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
simple-chat Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
simple-cmake-pkg examples : add missing code block end marker [no ci] (#17756) 2025-12-04 14:17:30 +01:00
speculative Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
speculative-simple Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
sycl chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
training Fix locale-dependent float printing in GGUF metadata (#17331) 2026-03-04 09:30:40 +01:00
CMakeLists.txt examples : add debug utility/example (#18464) 2026-01-07 10:42:19 +01:00
convert_legacy_llama.py metadata: Detailed Dataset Authorship Metadata (#8875) 2024-11-13 21:10:38 +11:00
json_schema_pydantic_example.py
json_schema_to_grammar.py examples : fix empty items in json_schema_to_grammar.py [no ci] (#19968) 2026-03-10 14:38:18 +01:00
llama.vim chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
pydantic_models_to_grammar.py pydantic : replace uses of __annotations__ with get_type_hints (#8474) 2024-07-14 19:51:21 -04:00
pydantic_models_to_grammar_examples.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
reason-act.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00
regex_to_grammar.py
server-llama2-13B.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00
server_embd.py llama : fix FA when KV cache is not used (i.e. embeddings) (#12825) 2025-04-08 19:54:51 +03:00
ts-type-to-grammar.sh scripts : make the shell scripts cross-platform (#14341) 2025-06-30 10:17:18 +02:00