Skip to content

Commit 64e357c

Browse files
ikawrakowIwan Kawrakow
andauthored
Fix compiler warnings (#788)
Co-authored-by: Iwan Kawrakow <[email protected]>
1 parent 6d2e7ca commit 64e357c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

include/llama.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,14 +1117,16 @@ extern "C" {
11171117

11181118
typedef void* llama_sampler_context_t;
11191119

1120+
struct llama_sampler;
1121+
11201122
// user code can implement the interface below in order to create custom llama_sampler
11211123
struct llama_sampler_i {
1122-
const char* (*name) (const struct llama_sampler* smpl); // can be NULL
1123-
void (*accept)(struct llama_sampler* smpl, llama_token token); // can be NULL
1124-
void (*apply) (struct llama_sampler* smpl, llama_token_data_array* cur_p); // required
1125-
void (*reset) (struct llama_sampler* smpl); // can be NULL
1126-
struct llama_sampler* (*clone) (const struct llama_sampler* smpl); // can be NULL if ctx is NULL
1127-
void (*free) (struct llama_sampler* smpl); // can be NULL if ctx is NULL
1124+
const char* (*name) (const struct llama_sampler*); // can be NULL
1125+
void (*accept)(struct llama_sampler*, llama_token); // can be NULL
1126+
void (*apply) (struct llama_sampler*, llama_token_data_array*); // required
1127+
void (*reset) (struct llama_sampler*); // can be NULL
1128+
struct llama_sampler* (*clone) (const struct llama_sampler*); // can be NULL if ctx is NULL
1129+
void (*free) (struct llama_sampler* smpl); // can be NULL if ctx is NULL
11281130
};
11291131

11301132
struct llama_sampler {
@@ -1147,6 +1149,7 @@ extern "C" {
11471149
size_t n_rules,
11481150
size_t start_rule_index);
11491151

1152+
struct llama_sampler_grammar;
11501153
LLAMA_API void llama_grammar_init_lazy(struct llama_sampler_grammar * grammar);
11511154

11521155
LLAMA_API void llama_grammar_free(struct llama_grammar * grammar);

0 commit comments

Comments
 (0)