File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1010struct 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
You can’t perform that action at this time.
0 commit comments