graphrag
graphrag copied to clipboard
[bug]Fix bad tune prompt for the LLM not support JSON.
Description
Prompt-Tune is too bad to generate a valid entity-extraction.txt when using OSS model which doesn't support json model.
The {record_delimiter} is very import, but graphrag didn't highlight that in the prompt and even the example is wrong, which cause lots of generated entity-extraction.txt prompt is bad, it is hard to use.
Related Issues
It will raise EmptyNetworkError when using the prompt generated by prompt-tune.
Proposed Changes
- Separate the request about
Use **{{record_delimiter}}** as the list delimiter.into 1 single item to highlight the request. - Add {{record_delimiter}} to the tail of each item of list in the example format.
- graphrag/prompt_tune/prompt/entity_relationship.py
- graphrag/prompt_tune/template/entity_extraction.py
Checklist
- [x] I have tested these changes locally.
- [x] I have reviewed the code changes.
- [ ] I have updated the documentation (if necessary).
- [ ] I have added appropriate unit tests (if applicable).
Additional Notes
[Add any additional notes or context that may be helpful for the reviewer(s).]
Hi! Can you please rebase your commit, to check if this is still valid?