mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-05-01 11:51:53 +00:00
Fix slot prompt updating. (#1285)
Co-authored-by: Rkozuch <you@example.com>
This commit is contained in:
@@ -953,6 +953,18 @@ bool server_context::launch_slot_with_task(server_slot& slot, server_task& task)
|
||||
// get prompt
|
||||
if (!task.infill) {
|
||||
slot.prompt_tokens = std::move(task.tokens);
|
||||
|
||||
const auto & prompt = data.find("prompt");
|
||||
if (prompt != data.end()) {
|
||||
if (prompt->is_string() ||
|
||||
(prompt->is_array() && !prompt->empty() && prompt->at(0).is_number_integer())) {
|
||||
slot.prompt = *prompt;
|
||||
} else if (prompt->is_array() && prompt->size() == 1 && prompt->at(0).is_string()) {
|
||||
slot.prompt = *prompt;
|
||||
} else if (prompt->is_array() && prompt->size() == 1 && prompt->at(0).is_array()) {
|
||||
slot.prompt = prompt->at(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// penalize user-provided tokens
|
||||
|
||||
Reference in New Issue
Block a user