Removing hacky include to llama.cpp from grammar integration test now that needed functions are available via internal API.

This commit is contained in:
Clint Herron 2024-04-04 09:50:02 -04:00
parent b7264d6efd
commit b930945fba
2 changed files with 7 additions and 3 deletions

View file

@ -918,7 +918,7 @@ tests/test-grammar-parser: tests/test-grammar-parser.cpp ggml.o llama.o grammar-
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
tests/test-grammar-integration: tests/test-grammar-integration.cpp ggml.o grammar-parser.o $(OBJS)
tests/test-grammar-integration: tests/test-grammar-integration.cpp ggml.o llama.o grammar-parser.o $(OBJS)
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)

View file

@ -2,8 +2,12 @@
#undef NDEBUG
#endif
#include "llama.cpp" // TODO: not great
#define LLAMA_API_INTERNAL
#include "ggml.h"
#include "llama.h"
#include "grammar-parser.h"
#include "unicode.h"
#include <cassert>
#include <string>
@ -30,7 +34,7 @@ expr ::= term ("+" term)*
term ::= numero
number ::= [0-9]+)""";
fprintf(stderr, "NOTE: Error message (\"error parsing grammar\") expected on following line during successful test:\n");
fprintf(stderr, "NOTE: Error message (\"parse: error parsing grammar: Undefined rule identifier 'numero'\") expected on following line during successful test:\n");
grammar_parser::parse_state parsed_grammar = grammar_parser::parse(grammar_str.c_str());