File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ Instead of a Pydantic model you can pass a string that represents a [JSON Schema
55
55
from pydantic import BaseModel
56
56
57
57
from outlines import models
58
- from outlines import text
58
+ from outlines import generate
59
59
60
60
model = models.transformers(" mistralai/Mistral-7B-v0.1" )
61
61
@@ -85,13 +85,13 @@ Outlines can infer the structure of the output from the signature of a function.
85
85
86
86
``` python
87
87
from outlines import models
88
- from outlines import text
88
+ from outlines import generate
89
89
90
90
def add (a : int , b : int ):
91
91
return a + b
92
92
93
93
model = models.transformers(" mistralai/Mistral-7B-v0.1" )
94
- generator = text. generate.json(model, add)
94
+ generator = generate.json(model, add)
95
95
result = generator(" Return two integers named a and b respectively. a is odd and b even." )
96
96
97
97
print (add(** result))
You can’t perform that action at this time.
0 commit comments