common : refactor common_sampler + grammar logic changes (#17937)

* common : refactor common_sampler + grammar logic changes

* tests : increase max_tokens to get needed response

* batched : fix uninitialized samplers
This commit is contained in:
Georgi Gerganov
2025-12-14 10:11:13 +02:00
committed by GitHub
parent 3238b1400c
commit 254098a279
27 changed files with 372 additions and 293 deletions
+6 -6
View File
@@ -568,10 +568,10 @@ int main(int argc, char ** argv) {
llama_context * ctx_ttc = NULL;
llama_context * ctx_cts = NULL;
common_init_result llama_init_ttc = common_init_from_params(params);
auto llama_init_ttc = common_init_from_params(params);
model_ttc = llama_init_ttc.model.get();
ctx_ttc = llama_init_ttc.context.get();
model_ttc = llama_init_ttc->model();
ctx_ttc = llama_init_ttc->context();
if (model_ttc == nullptr || ctx_ttc == nullptr) {
return ENOENT;
@@ -583,10 +583,10 @@ int main(int argc, char ** argv) {
params.embedding = true;
params.n_ubatch = params.n_batch;
common_init_result llama_init_cts = common_init_from_params(params);
auto llama_init_cts = common_init_from_params(params);
model_cts = llama_init_cts.model.get();
ctx_cts = llama_init_cts.context.get();
model_cts = llama_init_cts->model();
ctx_cts = llama_init_cts->context();
if (model_cts == nullptr || ctx_cts == nullptr) {
return ENOENT;