Skip to content

Commit e2c46fd

Browse files
committed
cont
ggml-ci
1 parent e020dc0 commit e2c46fd

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

examples/gbnf-validator/gbnf-validator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ static bool llama_sample_grammar_string(struct llama_grammar * grammar, const st
1616
auto decoded = decode_utf8(input_str, {});
1717
const auto & code_points = decoded.first;
1818

19-
const llama_grammar_rules & prev_rules = llama_grammar_get_rules (grammar);
19+
const llama_grammar_rules & rules = llama_grammar_get_rules (grammar);
2020
llama_grammar_stacks & cur_stacks = llama_grammar_get_stacks(grammar);
2121

2222
size_t pos = 0;
2323
for (auto it = code_points.begin(), end = code_points.end() - 1; it != end; ++it) {
2424
const llama_grammar_stacks prev_stacks = llama_grammar_get_stacks(grammar); // copy
2525

26-
llama_grammar_accept(prev_rules, prev_stacks, *it, cur_stacks);
26+
llama_grammar_accept(rules, prev_stacks, *it, cur_stacks);
2727

2828
if (cur_stacks.empty()) {
2929
error_pos = pos;

src/llama-impl.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
#define LLAMA_API_INTERNAL
44
#include "llama.h"
55

6-
#include <array>
7-
#include <set>
8-
#include <map>
9-
#include <cstdint>
10-
#include <random>
11-
126
#ifdef __has_include
137
#if __has_include(<unistd.h>)
148
#include <unistd.h>
@@ -24,7 +18,7 @@
2418

2519
// bump if necessary
2620
#define LLAMA_MAX_NODES 8192
27-
#define LLAMA_MAX_LAYERS 256
21+
#define LLAMA_MAX_LAYERS 512
2822
#define LLAMA_MAX_EXPERTS 160 // DeepSeekV2
2923

3024
#ifdef __GNUC__

tests/test-grammar-integration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ static bool match_string(const std::string & input, llama_grammar * grammar) {
4949

5050
const auto & code_points = decoded.first;
5151

52-
const llama_grammar_rules & prev_rules = llama_grammar_get_rules (grammar);
52+
const llama_grammar_rules & rules = llama_grammar_get_rules (grammar);
5353
llama_grammar_stacks & cur_stacks = llama_grammar_get_stacks(grammar);
5454

5555
for (auto it = code_points.begin(), end = code_points.end() - 1; it != end; ++it) {
5656
const llama_grammar_stacks prev_stacks = llama_grammar_get_stacks(grammar); // copy
5757

58-
llama_grammar_accept(prev_rules, prev_stacks, *it, cur_stacks);
58+
llama_grammar_accept(rules, prev_stacks, *it, cur_stacks);
5959

6060
if (cur_stacks.empty()) {
6161
// no stacks means that the grammar failed to match at this point

0 commit comments

Comments
 (0)