Skip to content

Commit

Permalink
fix missing text module
Browse files Browse the repository at this point in the history
  • Loading branch information
ibndias authored and rlouf committed Apr 8, 2024
1 parent 3a41b0e commit be662fe
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit be662fe

Please sign in to comment.