Unverified Commit 4e04eceb authored by Bowen Wang's avatar Bowen Wang Committed by GitHub
Browse files

[Bugfix] Use random hidden states in dummy sampler run (#18543)


Signed-off-by: default avatarBowen Wang <abmfy@icloud.com>
parent 71075029
......@@ -1721,6 +1721,10 @@ class GPUModelRunner(LoRAModelRunnerMixin):
self,
hidden_states: torch.Tensor,
) -> torch.Tensor:
# The dummy hidden states may contain special values,
# like `inf` or `nan`.
# To avoid breaking the sampler, we use a random tensor here instead.
hidden_states = torch.rand_like(hidden_states)
logits = self.model.compute_logits(hidden_states, None)
num_reqs = logits.size(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment