Open q-jackboylan opened 1 year ago
I am also having this issue. The output has additional JSON items that are not requested and does not complete the actual fields in the provided JSON schema. I have tried with openai gpt-4 and openai text-davinci-003. No errors thrown.
I have used the following notebook: https://github.com/guidance-ai/guidance/blob/main/notebooks/guaranteeing_valid_syntax.ipynb
I solve this by using " stop=','" in every field.
However, I agree, all examples fail to work properly for me.
Thank you, same problem here with local Huggingface models.
I've noticed that when stop is not set, gen tries to figure out the stop word like this:
next_text = getattr(next_node, "text", next_node) if next_node is not None else ""
unfortunately when next_node is ParseResults(['\\n```'], {})
the text
property returns empty string ''
I'm not sure how to get the proper string out of the ParseResults yet but it seems the .text does not work anymore in the recent handlebar version.
The bug When I run the Guaranteeing valid output syntax notebook, the model creates additional fields that weren't prompted.
program._exception
does not return any error.To Reproduce I'm running this on a Debian GCP VM instance but I can also reproduce it on Google Colab
System info (please complete the following information):
guidance.__version__
): guidance==0.0.64