-
Notifications
You must be signed in to change notification settings - Fork 595
Error in outlines.generate.choice: create_states_mapping throws ValueError: not enough values to unpack (expected 3, got 2) #585
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
Comments
Could you please include your version info in the version section? There was a change recently which may have fixed this
There's a good chance upgrading to latest (unreleased)
|
I was on 0.0.24 But now "outlines.generate.format" throws the same kind of error!
This is very weird, as I see that "create_states_mapping" should return only two objects: states_to_token_maps and empty_token_ids. But when I print what is returned, I see its 3 objects: Running the outlines.generate.choice method returns 2 objects correctly, the dictionary, and the set. |
Maybe found a quick fix: commenting out the @cache seems to fix this! i.e.
Not sure how this affects performance though, but:
With cache commented out: With cache: |
#566 should have fixed this. It invalidates the cache if the version is upgraded. Can you confirm which version you are running via |
I'm on: 0.0.25.dev15+g0cd9608 |
I found the source of the issue. Outlines cache is cleared if there's a version upgrade, however installing from
We need to ensure the version in @dnhkng as a temporary fix I recommend running |
Best route forward IMO:
|
Works in my environment. @dnhkng could you please confirm your reproduction code no longer fails in your conda environment if you run
|
Looks ok now! I'm still getting strings instead of floats, but I've raised a separate issue for that. |
Describe the issue as clearly as possible:
When I try the examples on the github front page, some do not work from a fresh conda environment.
Steps/code to reproduce the bug:
Expected result:
Error message:
Outlines/Python version information:
Version information
Context for the issue:
This is a very weird bug! If I run the "outlines.generate.format" code, very occasionally, I also get the "outlines.generate.choice" method to run too! But 99% of the time, I get this error.
I did some digging, and added some debug code:
When I run the working code, I see:
But the buggy code produces:
So, the function "create_states_mapping" is not returning the frozenset, so the tuple only has 2 on the 3 items to unpack!
The text was updated successfully, but these errors were encountered: