Skip to content

Commit 02efdf0

Browse files
HanClintoNeoZhangJianyu
authored andcommitted
JSON Schema to GBNF integration tests (ggml-org#7790)
* Adding simple bare-bones test for end-to-end integration test for json validation against auto-generated JSON-schema grammars. * Adding additional examples as documented in ggml-org#7789 . Also adding the ability to automatically output improperly failing grammars to debug output files so they can more easily be examined in the gbnf-validator program. * Uncommenting formerly commented tests so that they fail for others who are attempting to reproduce the bugs. * Merging improved schema test methods added by @ochafik in ggml-org#7797 * Adding #define to temporarily remove failing tests so that this PR can pass CI, but still be useful for other PRs that want to leverage the framework. * Fixing nits from ochafik. Removing escape slashes, adding additional failing cases, fixing some other strings. * Fixing grammar indentation to be consistent throughout file.
1 parent ed316c6 commit 02efdf0

File tree

2 files changed

+580
-21
lines changed

2 files changed

+580
-21
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ tests/test-grammar-parser: tests/test-grammar-parser.cpp ggml.o llama.o grammar-
10511051
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
10521052
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
10531053

1054-
tests/test-grammar-integration: tests/test-grammar-integration.cpp ggml.o llama.o grammar-parser.o $(OBJS)
1054+
tests/test-grammar-integration: tests/test-grammar-integration.cpp json-schema-to-grammar.o ggml.o llama.o grammar-parser.o $(OBJS)
10551055
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
10561056
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
10571057

0 commit comments

Comments
 (0)