microsoft / Trace

End-to-end Generative Optimization for AI Agents
https://microsoft.github.io/Trace/
MIT License
321 stars 20 forks source link

Unable to save functions to pickle #5

Closed z6Solutions closed 3 months ago

z6Solutions commented 3 months ago

When running the examples in "5 Minute Basics" in the docs, everything works fine until I go to save the optimized function to a pickle. I'm given this error:

PicklingError: Can't pickle <function eq at 0x7d4ab853f600>: it's not the same object as opto.trace.operators.eq

I've tried creating a brand new conda environment with only trace and autogen and it still gives the same error.

chinganc commented 3 months ago

@z6Solutions I can recreate the error. We will fix it soon.

chinganc commented 3 months ago

@z6Solutions I pushed a fix to that. Can you try again? Thank you.

z6Solutions commented 3 months ago

Still getting an error, but a new one. Now I get PicklingError: Can't pickle <function strange_sort_list at 0x7b70fc061580>: it's not the same object as __main__.strange_sort_list

chinganc commented 3 months ago

I can reproduce it.

chinganc commented 3 months ago

@z6Solutions I think it's fixed this time. Please try again, thanks.

z6Solutions commented 3 months ago

Works perfectly - thank you!