Skip to content
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 incorrect JSON formatting with llama #15

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

Unobfucator
Copy link
Contributor

@Unobfucator Unobfucator commented Feb 19, 2024

For some reason llama will try to be helpful and include a comment in the JSON format it returns which causes parsing issues (despite the best effort to tell it not to include any JSON comments). Added regex to replace everything from "//" to "\n" to ensure that we can properly parse the string to form a valid JSON.

Also updated the prompt to remove any "'" as that caused parsing problems (though removing the comments should fix it too)

From testing we no longer error out and continue on to try and send a transaction. Further work will be needed to maintain state on the data passed to the user.

Also as an extra, updated the gitignore to ignore some generated files.

For some reason llama will try to be helpful and include a comment in the JSON format the prompts ask it to return which causes parsing issues. Added regex to replace everything from "//" to "\n" to ensure that we can properly parse the string to form a valid JSON.

Also updated the prompt to remove any "'" as that caused parsing problems (though removing the comments should fix it too)
@betterbrand
Copy link
Contributor

Thank you @Unobfucator!

@betterbrand betterbrand merged commit d01a690 into MorpheusAIs:development Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants