Skip to content

Gnievesponce prompt tune embedd chunking#1826

Merged
nievespg1 merged 6 commits intomainfrom
gnievesponce-prompt-tune-embedd-chunking
Mar 31, 2025
Merged

Gnievesponce prompt tune embedd chunking#1826
nievespg1 merged 6 commits intomainfrom
gnievesponce-prompt-tune-embedd-chunking

Conversation

@nievespg1
Copy link
Copy Markdown
Contributor

Description

When running prompt tune using the automatic selection method, the system will attempt to embed all the text chunks within one request no matter the size of the payload.

By default, the batch-size should not be larger than 16 text chunks and the token count should be below 8191 for the whole batch.

Related Issues

#1825

Proposed Changes

Modify graphrag/prompt_tune/loader/input.py to add logic that chunks large embeddings jobs/request similarly to how we do it in the indexing workflow. Here is an example workflow with a correct batching strategy: graphrag/index/operations/embed_text/strategies/openai.py

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

No additional notes

@nievespg1 nievespg1 requested review from a team as code owners March 19, 2025 18:22
Comment thread graphrag/api/prompt_tune.py
@nievespg1 nievespg1 merged commit ffd8db7 into main Mar 31, 2025
15 checks passed
@nievespg1 nievespg1 deleted the gnievesponce-prompt-tune-embedd-chunking branch March 31, 2025 16:38
opensourcemukul pushed a commit to opensourcemukul/graphrag that referenced this pull request Sep 13, 2025
* Added support for embeddings chunking as defined by the  config.

* ran semvisor -t patch

* Eliminated redunant code by using the embed_text strategy directly

* Added fix to support brakets within the corpus text; For example, inline LaTeX within a markdown file

---------

Co-authored-by: Gabriel Nieves <gnievesponce@microsoft.com>
Brandsma pushed a commit to ThalamusLabs/MMGraphRAG that referenced this pull request Nov 6, 2025
* Added support for embeddings chunking as defined by the  config.

* ran semvisor -t patch

* Eliminated redunant code by using the embed_text strategy directly

* Added fix to support brakets within the corpus text; For example, inline LaTeX within a markdown file

---------

Co-authored-by: Gabriel Nieves <gnievesponce@microsoft.com>
JonasReuter pushed a commit to JonasReuter/graphrag that referenced this pull request Apr 13, 2026
* Added support for embeddings chunking as defined by the  config.

* ran semvisor -t patch

* Eliminated redunant code by using the embed_text strategy directly

* Added fix to support brakets within the corpus text; For example, inline LaTeX within a markdown file

---------

Co-authored-by: Gabriel Nieves <gnievesponce@microsoft.com>
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