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

Add functionality for a branching factor #17

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

jerryjliu
Copy link
Collaborator

@jerryjliu jerryjliu commented Nov 11, 2022

Adds a child branching factor for each parent node, so that instead of just exploring one child, it has the option to pick multiple children to explore, and refine the answer across multiple children. GPT Index does this recursively at every parent node, offering tons of opportunities to refine and expand the answer!

Example usage below (with branch factor 2):

Screen Shot 2022-11-10 at 12 06 32 AM

Here's branch factor 1 (the existing approach):
Screen Shot 2022-11-10 at 12 05 22 AM

As we can see the answer is much more detailed in the first.

Jerry Liu added 2 commits November 9, 2022 22:22
@jerryjliu jerryjliu merged commit 39b8c9e into main Nov 11, 2022
@jerryjliu jerryjliu deleted the jerry/tree_traverse_multiple branch November 11, 2022 02:48
viveksilimkhan1 pushed a commit to viveksilimkhan1/llama_index that referenced this pull request Oct 30, 2023
* Merged template() and parse() into task().

* Use spacy_llm.registry.

* Synch with main.

* Move python-dotenv to dev requirements.

* Fix typing in llm.py.

* Use TypeVars for typing.

* Fix typing for prompt Callable.

* Revert "Use spacy_llm.registry."

This reverts commit 88fa3aaaa37bedac03539d72e692a5902ffba8d1.

* Use alternative registry approach.

* Move python-dotenv back to requirements.txt.

* Move prompt config into API config.

* Introduce spacy-llm.registry.

* Update test sentence.

* Inverse api-prompt config flow. Inject api into prompt Callable to simplify config.

* Merge api.py into prompt.py.

* Add aliases for template and parse callables.

* Add alias for prompt Callable.

* Rename registry handle.

* Add warning for mismatching types.

* Simplify type check.

* Update spacy_llm/registry/prompt.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Add test for type checking/warning.

* Undo registry changes. Rename prompt to query. Inverse api-query nesting. Reframed role of api().

* Update spacy_llm/pipeline/llm.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Rename TypeVars. Shorten registry handles.

* Update spacy_llm/registry/api.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Simplify registry handles for backends

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Rename 'api' to 'backend'.

* Remove leftover comments.

* Update spacy_llm/pipeline/llm.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Fix misnamed variable

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Update spacy_llm/registry/task.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Update registry handles for query functions.

* Update readme.

* Bump version.

* Change sequence of backend params.

* Update README.md

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

---------

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.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.

None yet

1 participant