graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

[bug]Fix bad tune prompt for the LLM not support JSON.

Open KylinMountain opened this issue 1 year ago • 1 comments

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

  1. Separate the request about Use **{{record_delimiter}}** as the list delimiter. into 1 single item to highlight the request.
  2. 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).]

KylinMountain avatar Jul 23 '24 03:07 KylinMountain

Hi! Can you please rebase your commit, to check if this is still valid?

AlonsoGuevara avatar Aug 08 '24 21:08 AlonsoGuevara