graphrag
graphrag copied to clipboard
Fix prompt tuning sampling error when LIMIT is greater than number of…
Description
Prompt tuning errors out when the number of chunks is less than the default LIMIT, saying "Auto-prompt generation failed: Cannot take a larger sample than population when 'replace=False'"
Proposed Changes
This patch sets the limit to the min of LIMIT and the number of chunks.
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).