Skip to content

Commit 0840f8a

Browse files
committed
Fix: 'LM' object has no attribute 'copy'
1 parent f1583e3 commit 0840f8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dspy/clients/lm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def inspect_history(self, n: int = 1):
6565

6666
def copy(self, **kwargs):
6767
"""Returns a copy of the language model with the same parameters."""
68-
kwargs = {**self.kwargs, **kwargs}
69-
return self.__class__(model=self.model, **kwargs)
68+
kwargs = {**self.__dict__, **kwargs}
69+
return self.__class__(**kwargs)
7070

7171

7272
@functools.lru_cache(maxsize=None)

0 commit comments

Comments
 (0)