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

Extra capture emitted when gen has no explicit stop #7

Open
hudson-ai opened this issue Aug 14, 2024 · 0 comments
Open

Extra capture emitted when gen has no explicit stop #7

hudson-ai opened this issue Aug 14, 2024 · 0 comments

Comments

@hudson-ai
Copy link
Collaborator

This is fine

    model = models.Mock("<s>bbbbbbba")
    model += gen("list", stop="a", list_append=True)
    assert model["list"][-1] == "bbbbbbb"
    assert len(model["list"]) == 1

But the second assert fails here -- we instead get two items, the first being the empty string. The empty string gets emitted as a capture at the first call to mid-process, before any other tokens are consumed.

    model = models.Mock("<s>bbbbbbb<s>")
    model += gen("list", list_append=True)
    assert model["list"][-1] == "bbbbbbb"
    assert len(model["list"]) == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant