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

Fix serialization issue with W&B #5693

Merged
merged 3 commits into from
Jun 8, 2023

Conversation

jjzhuo
Copy link
Contributor

@jjzhuo jjzhuo commented Jun 4, 2023

The chain input_documents are not displaying properly in W&B, due to serialization issue:

Screenshot 2023-06-04 at 11 58 26 AM

@hwchase17
Copy link
Contributor

@parambharat how does this look to you?

@parambharat
Copy link
Contributor

The chain input_documents are not displaying properly in W&B, due to serialization issue:

Screenshot 2023-06-04 at 11 58 26 AM

Hi @jjzhuo , can you share an example of where you are seeing this ? A colab perhaps ?

@@ -79,7 +85,7 @@ def _convert_chain_run_to_wb_span(trace_tree: Any, run: Run) -> trace_tree.Span:

def _convert_tool_run_to_wb_span(trace_tree: Any, run: Run) -> trace_tree.Span:
base_span = _convert_run_to_wb_span(trace_tree, run)
base_span.results = [trace_tree.Result(inputs=run.inputs, outputs=run.outputs)]
base_span.results = [trace_tree.Result(inputs=serialize_inputs(run.inputs), outputs=run.outputs)]
Copy link
Contributor

Choose a reason for hiding this comment

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

@jjzhuo this should be _serialized_inputs

@jjzhuo
Copy link
Contributor Author

jjzhuo commented Jun 5, 2023

@parambharat The screenshot is from the Weights and Biases website.

You can reproduce it by adding a RetrievalQA in this notebook:
https://python.langchain.com/en/latest/integrations/agent_with_wandb_tracing.html

@parambharat
Copy link
Contributor

@jjzhuo , Thanks you for the fix. I have verified that the new _serialize_inputs method serializes the inputs of the StuffDocumentsChain in the following wandb run.

@hwchase17 , This LGTM.

Copy link
Contributor

@parambharat parambharat left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

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

thanks!

@hwchase17 hwchase17 added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jun 8, 2023
@hwchase17 hwchase17 merged commit 78aa59c into langchain-ai:master Jun 8, 2023
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this pull request Jun 19, 2023
The chain input_documents are not displaying properly in W&B, due to
serialization issue:

<img width="1164" alt="Screenshot 2023-06-04 at 11 58 26 AM"
src="https://github.com/hwchase17/langchain/assets/134809928/f31f14f6-0935-4cca-9913-6760cd40eadf">

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This was referenced Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants