Giter VIP home page Giter VIP logo

Comments (6)

parambharat avatar parambharat commented on June 21, 2024

Hi @MarkAWard . Thanks for raising this issue. I was able to reproduce this issue and am working on a fix. I will update here soon.

from wandb.

parambharat avatar parambharat commented on June 21, 2024

Hey, @MarkAWard: This PR should fix the serialization issue with the new RunV2 API. Can you please let me know if your use-case works as expected when run from the branch? I'll tag one of the LangChain maintainers once you confirm. - All unittests pass as of now in LangChain

from wandb.

MarkAWard avatar MarkAWard commented on June 21, 2024

Thanks @parambharat my use-case did work using your branch. With the change we did lose the model_dict that was previously passed to the WandbTraceTree, it's not as important to me as having the traces/spans working properly but did want to note that.

Would you be open to injecting the serializer as an optional dependency to the WandbTracer? Currently it just uses _serialize_io, but it would be nice to be able to extend or replace the serializer. For example in my branch I had added a condition to serialize pydantic objects:

def _serialize_io(run_inputs: Optional[dict]) -> dict:
    ...
        elif isinstance(value, (BaseModel, PydanticBaseModel)):
            serialized_inputs[key] = (
                value.model_dump_json()
                if hasattr(value, "model_dump_json")
                else value.json()
            )
    ...

from wandb.

ArtsiomWB avatar ArtsiomWB commented on June 21, 2024

Thank you so much for reporting this, @MarkAWard, and thank you so much for looking into it so fast, @parambharat! Tracking this thread from the wandb support's side as well.

from wandb.

parambharat avatar parambharat commented on June 21, 2024

Hi @MarkAWard,

With the change we did lose the model_dict that was previously passed to the WandbTraceTree, it's not as important to me as having the traces/spans working properly but did want to note that.

Thanks for pointing out the missing model_dict. I have pushed new changes to re-add the model architecture to the trace logging. You should now also see the Model Architecture tab in the logged traces.

Would you be open to injecting the serializer as an optional dependency to the WandbTracer?

I've added a new argument io_serializer to the WandTracer that allows you to pass a custom serializer. I've also included PydanticBaseModels in the serializer's defaults alongside the exisiting protobufs.

from wandb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.