Skip to content

Commit

Permalink
fix: embeddings/rerank processing
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Dec 12, 2024
1 parent 62a4bc8 commit 0e1f27b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llama-box/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2191,9 +2191,10 @@ struct server_context {

slot->reset();

slot->rid = task.rid;
slot->id_task = task.id;
slot->index = json_value(task.data, "index", 0);
slot->rid = task.rid;
slot->id_task = task.id;
slot->task_type = task.type;
slot->index = json_value(task.data, "index", 0);
// slot->prompt_tokens = task.prompt_tokens; // NB(thxCode): prompt_tokens will be processed in launch_slot_with_task

if (!launch_slot_with_task(*slot, task)) {
Expand Down Expand Up @@ -2758,7 +2759,7 @@ struct server_context {
}

// check that we are in the right batch_type, if not defer the slot
const int slot_type = slot.is_non_causal();
const int32_t slot_type = slot.is_non_causal() ? 1 : 0;
if (batch_type == -1) {
batch_type = slot_type;
} else if (batch_type != slot_type) {
Expand Down

0 comments on commit 0e1f27b

Please sign in to comment.