Skip to content

Commit d07c9f6

Browse files
committed
adapt
1 parent 6f56b57 commit d07c9f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/main/chat.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
struct llama_cli_chat {
1111
struct llama_context * ctx;
1212
const struct llama_model * model;
13+
const struct llama_vocab * vocab;
1314
struct common_sampler * smpl;
1415
struct common_params params;
1516

@@ -26,6 +27,7 @@ struct llama_cli_chat {
2627
struct llama_context * ctx,
2728
struct common_sampler * smpl) : ctx(ctx), smpl(smpl), params(params) {
2829
model = llama_get_model(ctx);
30+
vocab = llama_model_get_vocab(model);
2931
batch = llama_batch_init(params.n_batch, 0, 1);
3032
}
3133

@@ -130,7 +132,7 @@ struct llama_cli_chat {
130132
new_token_id = common_sampler_sample(smpl, ctx, -1);
131133

132134
// is it an end of generation?
133-
if (llama_token_is_eog(model, new_token_id)) {
135+
if (llama_vocab_is_eog(vocab, new_token_id)) {
134136
break;
135137
}
136138

0 commit comments

Comments
 (0)