fix model name missing in final response (#1250)

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
firecoperana 2026-02-07 10:31:39 -06:00 committed by GitHub
parent dbcbfdb0ef
commit f1ccf340dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -1631,12 +1631,11 @@ void server_context::send_final_response(server_slot& slot) {
res->timings = slot.get_timings(); res->timings = slot.get_timings();
res->post_sampling_probs = slot.params.post_sampling_probs; res->post_sampling_probs = slot.params.post_sampling_probs;
res->oaicompat = slot.params.oaicompat; res->oaicompat = slot.params.oaicompat;
res->oaicompat_model = slot.params.oaicompat_model;
res->oaicompat_cmpl_id = slot.params.oaicompat_cmpl_id; res->oaicompat_cmpl_id = slot.params.oaicompat_cmpl_id;
res->oaicompat_msg = slot.update_chat_msg(res->oaicompat_msg_diffs); res->oaicompat_msg = slot.update_chat_msg(res->oaicompat_msg_diffs);
res->n_decoded = slot.n_decoded; res->n_decoded = slot.n_decoded;
res->n_prompt_tokens = slot.n_prompt_tokens; res->n_prompt_tokens = slot.n_prompt_tokens;
res->oaicompat_model = slot.oaicompat_model; res->oaicompat_model = slot.task->params.oaicompat_model;
res->data = json{ res->data = json{
{"content", !slot.params.stream ? slot.generated_text : ""}, {"content", !slot.params.stream ? slot.generated_text : ""},
{"generated_text", slot.generated_text}, // Always include full text for finish_reason logic {"generated_text", slot.generated_text}, // Always include full text for finish_reason logic
@ -2590,9 +2589,9 @@ void server_context::batch_pending_prompt(const int32_t n_ubatch, const int32_t
slot.state = SLOT_STATE_PROCESSING; slot.state = SLOT_STATE_PROCESSING;
slot.command = SLOT_COMMAND_NONE; slot.command = SLOT_COMMAND_NONE;
send_final_response(slot);
slot.release(); slot.release();
slot.print_timings(); slot.print_timings();
send_final_response(slot);
continue; continue;
} }
@ -2933,9 +2932,9 @@ void server_context::speculative_decoding_accept() {
if (!process_token(result, slot)) { if (!process_token(result, slot)) {
// release slot because of stop condition // release slot because of stop condition
send_final_response(slot);
slot.release(); slot.release();
slot.print_timings(); slot.print_timings();
send_final_response(slot);
metrics.on_prediction(slot); metrics.on_prediction(slot);
break; break;
} }
@ -2953,7 +2952,7 @@ void server_context::speculative_decoding_accept() {
bool server_context::accept_special_token(const server_slot& slot, const llama_token token) { bool server_context::accept_special_token(const server_slot& slot, const llama_token token) {
return params_base.special || slot.sparams.preserved_tokens.find(token) != slot.sparams.preserved_tokens.end(); return params_base.special || slot.sparams.preserved_tokens.find(token) != slot.sparams.preserved_tokens.end();
}; }
void server_context::send_token_results(completion_token_outputs& results, server_slot& slot, int32_t n) { void server_context::send_token_results(completion_token_outputs& results, server_slot& slot, int32_t n) {
@ -2962,9 +2961,9 @@ void server_context::send_token_results(completion_token_outputs& results, serve
bool has_next = process_token(it, slot); bool has_next = process_token(it, slot);
count++; count++;
if (!has_next) { if (!has_next) {
send_final_response(slot);
slot.release(); slot.release();
slot.print_timings(); slot.print_timings();
send_final_response(slot);
metrics.on_prediction(slot); metrics.on_prediction(slot);
break; break;
} }

View File

@ -336,4 +336,5 @@ struct server_context {
// Re-aggregates all active vectors and updates the model state // Re-aggregates all active vectors and updates the model state
bool apply_control_vectors_internal(); bool apply_control_vectors_internal();
}; };