dspy
dspy copied to clipboard
Save kwargs for huggingface TGI model
Previously, using HFClientTGI
with BootstrapFewShot
didn't work for max_rounds
> 1. The culprit was:
File "<snip>/lib/python3.10/site-packages/dsp/modules/lm.py", line 84, in copy
model = kwargs.pop('model')
KeyError: 'model'
This PR makes sure the relevant kwargs are saved (all are necessary)
Thanks!
@okhat if this PR could be reviewed and merged would be amazing :)
Same issue for OllamaLocal(LM)
, but just saving it to kwargs messes with the copy
function of the LM
class.
Thanks @GuyAglionby ! just following up on old PRs :)