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: json load issue fix by prompt engineering #419

Closed
wants to merge 2 commits into from

Conversation

shijie2016
Copy link

@shijie2016 shijie2016 commented Oct 10, 2024

Description

In some cases, GPT-4o outputs text with a '‘’json prefix or similar formatting, which makes it impossible for json.load to parse the output correctly. This leads to program crashes when attempting to handle the JSON data.

Motivation and Context

#418

Modified all relevant prompts to ensure that GPT-4o outputs well-formed JSON without unwanted prefixes.
Improved the program's robustness to prevent crashes caused by incorrect output formatting.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--419.org.readthedocs.build/en/419/

@shijie2016
Copy link
Author

@shijie2016 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@shijie2016 shijie2016 closed this Oct 10, 2024
@shijie2016 shijie2016 reopened this Oct 10, 2024
@shijie2016
Copy link
Author

@microsoft-github-policy-service agree

@shijie2016
Copy link
Author

@shijie2016 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@shijie2016 shijie2016 closed this Oct 10, 2024
@shijie2016 shijie2016 reopened this Oct 10, 2024
@TPLin22
Copy link
Collaborator

TPLin22 commented Oct 14, 2024

Hi,

Thank you for bringing up this PR. The bug you mentioned might be due to JSON mode not being enabled. Additionally, we've addressed other JSON-related issues in a previous PR 386. Thank you for your contribution!

@you-n-g you-n-g mentioned this pull request Oct 15, 2024
@shijie2016 shijie2016 closed this Oct 22, 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