• Jesse Gross's avatar
    runner.go: Handle truncation of tokens for stop sequences · 0077e22d
    Jesse Gross authored
    When a single token contains both text to be return and a stop
    sequence, this causes an out of bounds error when we update the
    cache to match our text. This is because we currently assume that
    the removing the stop sequence will consume at least one token.
    
    This also inverts the logic to deal with positive numbers, rather
    than a value to be subtracted, which is easier to reason about.
    
    Fixes #7153
    0077e22d
runner.go 23.2 KB