-
Notifications
You must be signed in to change notification settings - Fork 590
Create the migration guide to v1 #1543
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
base: v1.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a solid document. I just have one remark.
|
||
### Text generation return types | ||
|
||
In the previous version of Outlines, the return type of the generators depended on the output type provided. For instance, if you passed a Pydantic model to the `generate.json` function, the return type was a Pydantic model instance. In the v1, the return type of a generator is always a `str`, the raw text generated by the model. You are responsible for parsing the text into the desired format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either we change this before releasing (cf Cameron's issue), or we can say "for now".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related issue for those reading along: #1526
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man this is so good! Left a handful of comments/suggestions/questions.
For instance, instead of: | ||
|
||
```python | ||
from outlines import generate | ||
|
||
model = ... | ||
generator = generate.choice(model, ["foo", "bar"]) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a Pydantic model example here as well?
```python | ||
from outlines import generate | ||
|
||
model = ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a few places in here where we omit the model construction (model = ...
or model = <transformers model>
). I'm wondering we add explicit constructors to continuously hammer the new interface into the reader's mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's a good idea
|
||
### Text generation return types | ||
|
||
In the previous version of Outlines, the return type of the generators depended on the output type provided. For instance, if you passed a Pydantic model to the `generate.json` function, the return type was a Pydantic model instance. In the v1, the return type of a generator is always a `str`, the raw text generated by the model. You are responsible for parsing the text into the desired format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related issue for those reading along: #1526
This PR creates a migration guide to help users of outlines v0 migrate their code to v1. For the location of the file, I followed the organization proposed by @cpfiffer in #1529