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 missing text module from json documentation #791

Merged
merged 1 commit into from
Apr 8, 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
6 changes: 3 additions & 3 deletions docs/reference/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Instead of a Pydantic model you can pass a string that represents a [JSON Schema
from pydantic import BaseModel

from outlines import models
from outlines import text
from outlines import generate

model = models.transformers("mistralai/Mistral-7B-v0.1")

Expand Down Expand Up @@ -85,13 +85,13 @@ Outlines can infer the structure of the output from the signature of a function.

```python
from outlines import models
from outlines import text
from outlines import generate

def add(a: int, b: int):
return a + b

model = models.transformers("mistralai/Mistral-7B-v0.1")
generator = text.generate.json(model, add)
generator = generate.json(model, add)
result = generator("Return two integers named a and b respectively. a is odd and b even.")

print(add(**result))
Expand Down
Loading