Studio: stop the model from replying twice when it refuses (#5775)

This commit is contained in:
oobabooga 2026-05-26 09:30:52 -03:00 committed by GitHub
commit ef6744253f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,9 @@ _INTENT_SIGNAL = re.compile(
# Handles both straight and curly apostrophes.
# Excludes "I can", "I should", "I want to", "let's" which
# appear frequently in direct answers / explanations.
r"\b(i['\u2019](ll|m going to|m gonna)|i am (going to|gonna)|i will|i shall|let me|allow me)\b"
# Negative lookahead drops negated forms ("I will not", "I'll never")
# so a refusal doesn't trigger a re-prompt.
r"\b(i['\u2019](ll|m going to|m gonna)|i am (going to|gonna)|i will|i shall|let me|allow me)\b(?!\s+(?:not|never)\b)"
r"|"
# Step/plan framing: "First ...", "Step 1:", "Here's my plan"
r"\b(?:first\b|step \d+:?|here['\u2019]?s (?:my |the |a )?(?:plan|approach))"