Replies: 3 comments 6 replies
-
I am having the same problem? any luck? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Struggling with the same thing but with OpenAI |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a project that was made with llama2 and Guidance.
Now I wanted to transfer it to Azure using Gpt-Turbo, the problem it's that i cannot use the most basic Guidance function cause i get ConstraintException error.
I Share here the code and the error that i get really similar for both of these basic guidance query:
--- CODE ---
--- ERROR---
Exception has occurred: ConstraintException
The model attempted to generate b's an AI language' after the prompt
b'...f life?<|im_end|><|im_start|>assistant\nA'
, but that doesnot match the given grammar constraints! Since your model is a remote API that does not support full guidance
integration we cannot force the model to follow the grammar, only flag an error when it fails to match.
You can try to address this by improving the prompt, making your grammar more flexible, rerunning with
a non-zero temperature, or using a model that supports full guidance grammar constraints.
File "C:\ProgrammiX\PYTHON_SCRIPTS\EXAMPLES\Guidance_Examples\Guidance_Llama_llamacpp_Chat_Azure.py", line 43, in
lm += "Answer: "" + gen("meaning",max_tokens=50,stop=""",suffix=""",temperature=0.5)
guidance.models._model.ConstraintException: The model attempted to generate b's an AI language' after the prompt
b'...f life?<|im_end|><|im_start|>assistant\nA'
, but that doesnot match the given grammar constraints! Since your model is a remote API that does not support full guidance
integration we cannot force the model to follow the grammar, only flag an error when it fails to match.
You can try to address this by improving the prompt, making your grammar more flexible, rerunning with
a non-zero temperature, or using a model that supports full guidance grammar constraints.
Beta Was this translation helpful? Give feedback.
All reactions