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 the double {{ and }} when model_supports_json: false #503

Closed
wants to merge 3 commits into from

Conversation

s106916
Copy link
Contributor

@s106916 s106916 commented Jul 11, 2024

Description

When using azure openai gpt4 with text-embedding-ada-002, we have to setup model_supports_json: false in setting.yml. We will have invalid json format error with {{ }} in json string.

Related Issues

setting.yml
...
type: azure_openai_chat
model: gpt-4
model_supports_json: false
...
type: openai_embedding # or azure_openai_embedding
model: text-embedding-ada-002

Proposed Changes

replace '{{' and '}}' with '{' and '}'

Checklist

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

Additional Notes

Copy link
Contributor

@AlonsoGuevara AlonsoGuevara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR name suggests one fix, but introduces something very different. Please double check.

@s106916
Copy link
Contributor Author

s106916 commented Jul 13, 2024

This PR name suggests one fix, but introduces something very different. Please double check.

Yes, I can see a lot of places with JSON validation issues. I will work on a more generic solution.

@AlonsoGuevara
Copy link
Contributor

This PR name suggests one fix, but introduces something very different. Please double check.

Yes, I can see a lot of places with JSON validation issues. I will work on a more generic solution.

There's a central method for json validation if parsing fails at first instance.
Also, I think you commited your fork's readme by mistake.

@s106916
Copy link
Contributor Author

s106916 commented Jul 15, 2024

we have a better version for the malfunction json fix here. I will close this PR.
#551

@s106916 s106916 closed this Jul 15, 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