From f11eb90fe42db9043d4d3a15a16def8f3c33cbdd Mon Sep 17 00:00:00 2001 From: Enrique Shockwave <33002121+qeternity@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:28:02 +0000 Subject: [PATCH] Initialize model_worker_batch variable (#1973) --- python/sglang/srt/managers/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py index f0d191a29..49159923a 100644 --- a/python/sglang/srt/managers/scheduler.py +++ b/python/sglang/srt/managers/scheduler.py @@ -787,8 +787,8 @@ class Scheduler: self.forward_ct += 1 if self.is_generation: + model_worker_batch = batch.get_model_worker_batch() if batch.forward_mode.is_decode() or batch.extend_num_tokens != 0: - model_worker_batch = batch.get_model_worker_batch() batch.mark_reqs_started() logits_output, next_token_ids = self.tp_worker.forward_batch_generation( model_worker_batch