-
Notifications
You must be signed in to change notification settings - Fork 16
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
Gml 1821 graphrag retriever #263
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parkererickson-tg
requested review from
RobRossmiller-TG,
billshitg and
luzhoutg
August 19, 2024 16:15
billshitg
approved these changes
Aug 19, 2024
RobRossmiller-TG
suggested changes
Aug 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One update to the async code within the retriever. Otherwise lgtm
I tried this but it didn’t play nicely with FastAPI.
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: RobRossmiller-TG ***@***.***>
Sent: Monday, August 19, 2024 7:21:51 PM
To: tigergraph/CoPilot ***@***.***>
Cc: Parker Erickson ***@***.***>; Author ***@***.***>
Subject: Re: [tigergraph/CoPilot] Gml 1821 graphrag retriever (PR #263)
@RobRossmiller-TG requested changes on this pull request.
One update to the async code within the retriever. Otherwise lgtm
________________________________
In copilot/app/supportai/retrievers/GraphRAG.py<#263 (comment)>:
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+ tasks = [self._generate_candidate(question, c) for c in context]
+ res = loop.run_until_complete(asyncio.gather(*tasks))
+ loop.close()
+ return res
+
+ def retrieve_answer(self,
+ question: str,
+ community_level: int,
+ top_k_answer_candidates: int = 1):
+ retrieved = self.search(question, community_level)
+ context = [x["attributes"] for x in retrieved[0]["selected_comms"]]
+
+ with ThreadPoolExecutor() as executor:
+ res = executor.submit(self.gather_candidates, question, context).result()
If we're going to mix async and not, we can just use an asyncio runner<https://docs.python.org/3/library/asyncio-runner.html#running-an-asyncio-program> instead of starting a new thread and running asyncio in that
—
Reply to this email directly, view it on GitHub<#263 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A36AN3Q7G2NFW5AMUK7Q2Z3ZSKDZ7AVCNFSM6AAAAABMYEWX7SVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENBWG42TCMRWHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
RobRossmiller-TG
approved these changes
Aug 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.