Skip to content

Commit 60e53e5

Browse files
Qiaolin-Yutarinkk
authored andcommitted
[Fix] Unload lora in HF_Runner if needed (sgl-project#5899)
1 parent f727c84 commit 60e53e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/sglang/test/runners.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ def forward_generation_raw(
423423
)
424424
del input_logits
425425

426+
if lora_paths is not None and lora_paths[i] is not None:
427+
# Unload the LoRA adapter if it is used
428+
model.unload()
429+
426430
return ModelOutput(
427431
output_strs=output_strs,
428432
top_input_logprobs=top_input_logprobs,

0 commit comments

Comments
 (0)