Generate: sequence bias can handle same terminations (#24822)
This commit is contained in:
@@ -520,6 +520,9 @@ class LogitsProcessorTest(unittest.TestCase):
|
||||
input_ids = torch.tensor([[0, 1, 3, 1], [0, 1, 0, 1]], device=torch_device, dtype=torch.long)
|
||||
positive_bias = {(1,): 100.0, (4,): 100.0}
|
||||
negative_bias = {(1, 0): -100.0, (0, 1, 2): -100.0, (1, 3, 1, 3): -100.0}
|
||||
# biases the same termination twice, to ensure we can handle overlapping terminations (it won't have an effect
|
||||
# on the test cases, though)
|
||||
negative_bias.update({(1, 3, 1, 3, 1, 3): -100.0})
|
||||
sequence_bias = {**positive_bias, **negative_bias}
|
||||
|
||||
# scores = 0 to facilitate checks
|
||||
|
||||
Reference in New Issue
Block a user