fix bug of always capture lora even no-lora case

Signed-off-by: Yu Gong <yu3.gong@gmail.com>
This commit is contained in:
Yu Gong 2025-12-18 21:22:25 +00:00
parent aa7917aaaa
commit 3b5270a6af

View File

@ -195,10 +195,12 @@ class LoRAModelRunnerMixin:
for lora_id in range(1, effective_num_loras + 1)
}
if lora_requests:
self._set_active_loras(
tuple(sample_lora_mapping), tuple(token_lora_mapping), lora_requests
)
# Always call _set_active_loras to ensure the mapping is updated.
# This is important when capturing no-LoRA graphs (effective_num_loras=0)
# after capturing LoRA graphs, as we need to clear the previous mapping.
self._set_active_loras(
tuple(sample_lora_mapping), tuple(token_lora_mapping), lora_requests
)
yield