Skip to content

Commit e9dcea1

Browse files
author
mike dupont
committed
adding debug ebnf
1 parent a342166 commit e9dcea1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ set(CMAKE_CUDA_ARCHITECTURES "60;61;70") # needed for f16 CUDA intrinsics
2222
set(CUDACXX /usr/local/cuda-12.2/bin/nvcc)
2323
#GGML_USE_CUBLAS
2424

25+
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
26+
2527
if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
2628
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
2729
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")

common/grammar-parser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace grammar_parser {
2727
static uint32_t get_symbol_id(parse_state & state, const char * src, size_t len) {
2828
uint32_t next_id = static_cast<uint32_t>(state.symbol_ids.size());
2929
auto result = state.symbol_ids.insert(std::make_pair(std::string(src, len), next_id));
30+
fprintf(stderr, "added id %s with id %d\n",src,next_id);
3031
return result.first->second;
3132
}
3233

@@ -41,8 +42,11 @@ namespace grammar_parser {
4142
uint32_t rule_id,
4243
const std::vector<llama_grammar_element> & rule) {
4344
if (state.rules.size() <= rule_id) {
45+
fprintf(stderr, "resize id %d\n",rule_id);
4446
state.rules.resize(rule_id + 1);
4547
}
48+
49+
fprintf(stderr, "adding rule id %d\n",rule_id);
4650
state.rules[rule_id] = rule;
4751
}
4852

0 commit comments

Comments
 (0)