mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-01-22 15:14:34 +08:00
[V1] Do not store None in self.generators (#11038)
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
This commit is contained in:
parent
5ed5d5f128
commit
6faec54505
@ -102,6 +102,8 @@ class InputBatch:
|
||||
self.top_k_reqs: Set[str] = set()
|
||||
|
||||
# req_index -> generator
|
||||
# NOTE(woosuk): The indices of the requests that do not have their own
|
||||
# generator should not be included in the dictionary.
|
||||
self.generators: Dict[int, torch.Generator] = {}
|
||||
|
||||
self.num_logprobs: Dict[str, int] = {}
|
||||
@ -147,7 +149,10 @@ class InputBatch:
|
||||
if sampling_params.top_k > 0:
|
||||
self.top_k_reqs.add(req_id)
|
||||
|
||||
self.generators[req_index] = request.generator
|
||||
# NOTE(woosuk): self.generators should not include the requests that
|
||||
# do not have their own generator.
|
||||
if request.generator is not None:
|
||||
self.generators[req_index] = request.generator
|
||||
|
||||
num_logprobs = sampling_params.logprobs
|
||||
if num_logprobs is not None and num_logprobs > 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user