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 samplers documentation #980

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/cookbook/classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Outlines provides a shortcut to do multi-label classification, using the `outlin
```python
from outlines.samplers import greedy

generator = outlines.generate.choice(model, ["URGENT", "STANDARD"], sampler=greedy)
generator = outlines.generate.choice(model, ["URGENT", "STANDARD"], sampler=greedy())
```
Outlines supports batched requests, so we will pass two requests to the model:

Expand Down Expand Up @@ -96,7 +96,7 @@ class Classification(BaseModel):
and we can use `generate.json` by passing this Pydantic model we just defined, and call the generator:

```python
generator = outlines.generate.json(model, Classification, sampler=greedy)
generator = outlines.generate.json(model, Classification, sampler=greedy())
labels = generator(prompts)
print(labels)
# [Classification(label=<Label.urgent: 'URGENT'>), Classification(label=<Label.standard: 'STANDARD'>)]
Expand Down
Loading