You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
str.find() returns the first occurrence. If the same sentence appears more than once (e.g. two different citations on "The sky is blue." repeated in the response), every citation after the first gets response_begin/response_end pointing at the first occurrence. Consumers slicing response[begin:end] get the wrong span.
Granite 3.2 uses explicit match indices and doesn't have this issue.
Fix direction:find(text, offset) advancing past consumed positions, with care for the multiple-citations-per-sentence case (same sentence → same span, offset should advance only when the sentence changes).
Test needed: two identical sentences with different citations — assert span 0 covers the first occurrence, span 1 the second.
Activity
planetf1 commentedon Apr 15, 2026
Proposing to not implement this until #845 is merged as this hits the same file
fix: granite33 citation spans wrong for duplicate sentences (generati…
fix: granite33 citation spans wrong for duplicate sentences (#851) (#872
fix: granite33 citation spans wrong for duplicate sentences (generati…