"git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "03c039c48ee350bb7513584bfe23fd58bd016a7e"
Commit 4cdea1cc authored by Taylor Robie's avatar Taylor Robie
Browse files

skip bisection when it is not needed

parent d569b531
......@@ -826,6 +826,10 @@ class BisectionDataConstructor(BaseDataConstructor):
(neg_item_choice - self._total_negatives[right_index])
)[use_shortcut]
if np.all(use_shortcut):
# The bisection code is ill-posed when there are no elements.
return output
not_use_shortcut = np.logical_not(use_shortcut)
left_index = left_index[not_use_shortcut]
right_index = right_index[not_use_shortcut]
......
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