Unverified Commit ac60dc7f authored by Nick Hill's avatar Nick Hill Committed by GitHub
Browse files

[V1][BugFix] Fix for mixed top_k batch (#14301)


Signed-off-by: default avatarNick Hill <nhill@redhat.com>
Co-authored-by: default avatarYe Cao <caoye.cao@alibaba-inc.com>
parent a4f1ee35
...@@ -264,9 +264,12 @@ class InputBatch: ...@@ -264,9 +264,12 @@ class InputBatch:
self.top_p_cpu[req_index] = sampling_params.top_p self.top_p_cpu[req_index] = sampling_params.top_p
if sampling_params.top_p < 1: if sampling_params.top_p < 1:
self.top_p_reqs.add(req_id) self.top_p_reqs.add(req_id)
self.top_k_cpu[req_index] = sampling_params.top_k top_k = sampling_params.top_k
if sampling_params.top_k > 0: if 0 < top_k < self.vocab_size:
self.top_k_reqs.add(req_id) self.top_k_reqs.add(req_id)
else:
top_k = self.vocab_size
self.top_k_cpu[req_index] = top_k
self.min_p_cpu[req_index] = sampling_params.min_p self.min_p_cpu[req_index] = sampling_params.min_p
self.frequency_penalties_cpu[ self.frequency_penalties_cpu[
req_index] = sampling_params.frequency_penalty req_index] = sampling_params.frequency_penalty
......
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