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

LLM generates text that the grammar does not allow #4

Closed
mattiasarro opened this issue May 30, 2023 · 1 comment
Closed

LLM generates text that the grammar does not allow #4

mattiasarro opened this issue May 30, 2023 · 1 comment

Comments

@mattiasarro
Copy link

When running the example code, the following exception gets thrown:

UnexpectedCharacters: No terminal matches '"' in the current parser context, at line 1 col 7

The model had generated output {"a": " and the parser did not parse this particular output. Since {"a": " is a valid start of a JSON object, the error is a bit confusing. But playing around with different grammar, prompts and models a bit shows that the model can (and often does) generate text the parser can not parse, which results in lark.lexer.UnexpectedCharacters exception.

@mattiasarro
Copy link
Author

This is actually a bug in rellm, created a PR there.

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