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

Adding RAG tracing & eval cookbook using Parea #390

Merged
merged 10 commits into from
Apr 30, 2024

Conversation

joschkabraun
Copy link
Contributor

No description provided.


def _run_worker_in_context():
self._thread_worker_func()
self.worker = threading.Thread(target=contextvars.copy_context().run, args=(_run_worker_in_context, ))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you tell me why this is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required to make tracing of the pipeline possible with Parea AI. The tracing mechanism relies on contextvars to create a hierarchy of function/LLM calls. By creating a new Thread, this context is otherwise lost.

examples/quick_start/images/rag/rag-trace.gif Outdated Show resolved Hide resolved
@joschkabraun joschkabraun requested a review from merrymercy April 29, 2024 13:21
@merrymercy merrymercy merged commit 5c5aba5 into sgl-project:main Apr 30, 2024
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