From 45f92c00cf1752ae27b4e8a08a560abf08cc6cd2 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 0159053b..bb37c5f3 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -423,7 +423,9 @@ class Scheduler: 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: