File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
examples/offline_inference Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ def main():
138
138
sampling_params = SamplingParams (temperature = args .temp , max_tokens = args .output_len )
139
139
if not args .custom_mm_prompts :
140
140
outputs = llm .generate (
141
- TokensPrompt (prompt_token_ids = prompt_ids ) ,
141
+ [ TokensPrompt (prompt_token_ids = x ) for x in prompt_ids ] ,
142
142
sampling_params = sampling_params ,
143
143
)
144
144
else :
Original file line number Diff line number Diff line change @@ -365,9 +365,14 @@ def generate_uniform_probs(
365
365
A tensor of shape `(num_tokens, )` containing uniform
366
366
random values in the range [0, 1).
367
367
"""
368
+ # NOTE(woosuk): We deliberately use float64 instead of float32 here
369
+ # because when using float32, there's a non-negligible chance that
370
+ # uniform_prob is sampled to be exact 0.0 as reported in
371
+ # https://github.com/pytorch/pytorch/issues/16706. Using float64
372
+ # mitigates the issue.
368
373
uniform_probs = torch .rand (
369
374
(num_tokens , ),
370
- dtype = torch .float32 ,
375
+ dtype = torch .float64 ,
371
376
device = device ,
372
377
)
373
378
start_idx = 0
You can’t perform that action at this time.
0 commit comments