From be662fe3c7fd09c728ae648f5a0ca7286fb1e943 Mon Sep 17 00:00:00 2001 From: Derry Pratama Date: Mon, 8 Apr 2024 12:19:01 +0900 Subject: [PATCH] fix missing text module --- docs/reference/json.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/json.md b/docs/reference/json.md index b13e707e1..b3c89fa90 100644 --- a/docs/reference/json.md +++ b/docs/reference/json.md @@ -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") @@ -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))