allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.61k stars 651 forks source link

ClearMLCallbackHandler.on_chain_end and ClearMLCallbackHandler.on_chain_start raise exceptions of missing key #1126

Open mdziezyc opened 1 year ago

mdziezyc commented 1 year ago

Describe the bug

In my langchain program, I constantly get errors with missing key output in outputs and input in inputs:

WARNING:langchain.callbacks.manager:Error in ClearMLCallbackHandler.on_chain_end callback: 'output'
WARNING:langchain.callbacks.manager:Error in ClearMLCallbackHandler.on_chain_start callback: 'input'

To reproduce

Unfortunately, I wasn't able to create a minimal example of the code which reproduces this bug.

But I did check what are the keys of incoming dictionaries before the exception occurs:

inputs.keys() in on_chain_start:

outputs.keys() in on_chain_end:

If I'm able to narrow down the problem I'll report my findings. I hope that maybe someone had similar issues and could shed some light on the problem.

Expected behaviour

Both functions should handle different structures of dictionaries

Environment

eugen-ajechiloae-clearml commented 12 months ago

Hi @mdziezyc ! We are looking into this problem and https://github.com/allegroai/clearml/issues/1124 and we will come back to you as soon as we have a fix.

If you could create a minimal example that would, indeed, be of great help.

mdziezyc commented 12 months ago

The only thing I can add for now is that I checked W&B and it worked well, so it does not seem to be something specific related to my code. If I find sth more, I'll let you know.

eugen-ajechiloae-clearml commented 11 months ago

@mdziezyc we have submitted a PR related to this issue and #1124 : https://github.com/langchain-ai/langchain/pull/11472

pollfly commented 8 months ago

Hey @mdziezyc! Just letting you know that this issue has been resolved. See https://github.com/langchain-ai/langchain/pull/11472. Let us know if there are any issues :)