Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generating partially valid tokens #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on May 30, 2023

  1. ReTokenFilter.is_valid_token: partial=False

    Matching a regex partially can lead to generating a token which causes the whole generated sequence to be invalid.
    mattiasarro committed May 30, 2023
    Configuration menu
    Copy the full SHA
    4c6b8cb View commit details
    Browse the repository at this point in the history

Commits on May 31, 2023

  1. fix handling of partial tokens

    When using partial=True, we ensure we don't generate invalid output, but also this makes it impossible to generate certain output sequences. Therefore it's necessary to allow generating tokens which match only partially, and then take the substring of that token which matches the regex.
    mattiasarro committed May 31, 2023
    Configuration menu
    Copy the full SHA
    a9da752 View commit details
    Browse the repository at this point in the history