mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 05:34:57 +08:00
[Bugfix] Use random hidden states in dummy sampler run (#18543)
Signed-off-by: Bowen Wang <abmfy@icloud.com>
This commit is contained in:
parent
71075029f2
commit
4e04eceb58
@ -1721,6 +1721,10 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
|||||||
self,
|
self,
|
||||||
hidden_states: torch.Tensor,
|
hidden_states: torch.Tensor,
|
||||||
) -> 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)
|
logits = self.model.compute_logits(hidden_states, None)
|
||||||
num_reqs = logits.size(0)
|
num_reqs = logits.size(0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user