From 27e68e928454d9295ccd0cd9a7525783176be999 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Mon, 10 Jun 2024 06:23:14 +0700 Subject: [PATCH] [Bugfix] Fix KeyError: 1 When Using LoRA adapters (#5164) --- vllm/core/scheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index 0159053b4dc6a..bb37c5f313617 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -423,7 +423,9 @@ def _schedule_running( num_running_seqs = seq_group.get_max_num_running_seqs() budget.subtract_num_seqs(seq_group.request_id, num_running_seqs) - if curr_loras is not None and seq_group.lora_int_id > 0: + + if (curr_loras is not None and seq_group.lora_int_id > 0 + and seq_group.lora_int_id in curr_loras): curr_loras.remove(seq_group.lora_int_id) if running_queue: