Closed thiagodsd closed 4 weeks ago
Hey @thiagodsd ! Thanks for opening this issue.
Specifically, I receive an error when setting max_rounds to a value greater than 1:
This seems to be the core thing. When you do max_rounds > 1, BootstrapFewShot tries to copy your LM.
It seems that your LM object does not support .copy?
Thank you for all the hard work maintaining this project!
It seems that your LM object does not support .copy?
I think you're right, it probably doesn't. In my company, due to security concerns, we can't directly access language models via API. Instead, we use proprietary packages as middlemen or compiled models on platforms like SageMaker.
Do you think it would be a good idea to implement the copy
method in the language model class before wrapping it in CustomLMClient
? Or is there a way to tweak dspy.LM
to handle this scenario?
Hi @thiagodsd , following the dspy.LM
copy method should help here for your CustomLMClient use case.
Thanks for the suggestion, @arnavsinghvi11! I'll explore some workarounds in that direction.
It's a bit surprising that my CustomLMClient didn't inherit this method from the LM class... I'll dig deeper into why that might be happening and see if there's something specific in my implementation causing this. Appreciate your input!
Thank you, @arnavsinghvi11, for your helpful suggestion! I implemented the copy method, and it worked perfectly. I'll close this issue now.
I'm encountering a problem when using BootstrapFewShot with custom language models (LM) and datasets. Specifically, I receive an error when setting max_rounds to a value greater than 1:
I’m unable to share detailed logs or code snippets due to company policies, but I can provide a general outline of my setup:
The content of the experiment seems unrelated to the issue since everything works as expected when max_rounds=1. However, setting max_rounds to a value greater than 1 causes the process to complete one iteration (the progress bar reaches 100%) before triggering the error mentioned above.