Skip to content

Commit be662fe

Browse files
ibndiasrlouf
authored andcommitted
fix missing text module
1 parent 3a41b0e commit be662fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/reference/json.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Instead of a Pydantic model you can pass a string that represents a [JSON Schema
5555
from pydantic import BaseModel
5656

5757
from outlines import models
58-
from outlines import text
58+
from outlines import generate
5959

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

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

8686
```python
8787
from outlines import models
88-
from outlines import text
88+
from outlines import generate
8989

9090
def add(a: int, b: int):
9191
return a + b
9292

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

9797
print(add(**result))

0 commit comments

Comments
 (0)