Skip to content

Commit 1f6b592

Browse files
committed
fix
1 parent bc9b84e commit 1f6b592

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/sglang/srt/lora/layers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,11 @@ def set_lora_info(
219219
self.B_buffer_qkv[:, output_dim_q + output_dim_kv :, :].copy_(
220220
B_buffer_kv[1]
221221
)
222-
223-
# Offsets of q/k/v in output dimension
224-
self.output_offset = torch.tensor(
222+
if not hasattr(self, "output_offset") or self.output_offset is None:
223+
self.output_offset = torch.empty(
224+
4, dtype=torch.int32, device=B_buffer_q.device
225+
)
226+
self.output_offset[:4] = torch.tensor(
225227
[
226228
0,
227229
output_dim_q,

0 commit comments

Comments
 (0)