-
Notifications
You must be signed in to change notification settings - Fork 484
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 samplers documentation #980
Conversation
Thanks for identifying and working towards fixing this issue! Could we fix the docs instead of changing the code though? Some lines in the documentation and tests rely on samplers being callable, e.g.
|
I understand that there are tests written regarding this, but something doesn't seem to be working correctly. The first line of the classification docs is as follows: from outlines.samplers import greedy This is where the issue begins. A potential solution would be to do the following in the docs: from outlines.samplers import BeamSearchSampler, GreedySampler, MultinomialSampler
generator = outlines.generate.choices(model, ["URGENT", "STANDARD"], sampler=GreedySampler()) However, then that begs the question of whether |
And one thing about the about a test like: tests/test_samplers.py: assert beam_search == BeamSearchSampler In this context, |
The test is correct, it's asserting that |
Ok, sounds good. I will make the necessary changes. |
It should be good to go |
Thank you! |
This fixes issue #978. Specifically for the classification example in the outlines cookbook section here, it fixes the piece of code in outlines.generate.api.SequenceGeneratorAdapter that keeps returning the wrong result (i.e. returning False even if a specific sampler is passed (greedy, multinomial, or beam search).