-
Notifications
You must be signed in to change notification settings - Fork 399
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
Fix whitespace and control character handling in JSON guidance #283
Fix whitespace and control character handling in JSON guidance #283
Conversation
f9cd7e6
to
f1e925f
Compare
f1e925f
to
7b088f4
Compare
I have tried the codellama with the latest version outlines,it seems that the white space is fixed. But sometimes it comes up with an error as followed:
|
Yeah, see #280 (comment). You can try it again with the changes in #272, and you shouldn't see that issue; however, if you do, or see another issue, don't hesitate to report it! |
Sorry but the problems remains : │ /home/jeeves/pr/outlines/outlines/text/generate/regex.py:118 in create_proposal │ |
And my main.py is as below:from enum import Enum import sys import outlines.models as models import torch class Weapon(str, Enum): class Armor(str, Enum): class Character(BaseModel): model_path = "/mnt/data/user/models/CodeLlama-7b-hf" model = models.transformers(model_path,device="cuda") generator = generate.json(model, Character) sequence = generator("Give me a interesting character description") |
Those tracebacks are from the current code in |
Yes,I have tried the #272 branch, and the problem remains the same,I am not sure why "not enough values to unpack (expected 1, got 0)" |
If |
This PR allows whitespace characters according to the JSON grammar and disallows control characters in strings.
It also cleans up the project dependencies and pins
beartype
to a version below 0.16.0, because that version appears to be out of sync with its dependent packagepytorch
.