Skip to content

Commit b5584d8

Browse files
change the assert (#7897)
1 parent 0bb3fd4 commit b5584d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dspy/predict/predict.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from pydantic import BaseModel
44

5+
from dspy.clients.base_lm import BaseLM
6+
from dspy.clients.lm import LM
57
from dspy.predict.parameter import Parameter
68
from dspy.primitives.prediction import Prediction
79
from dspy.primitives.program import Module
810
from dspy.signatures.signature import ensure_signature
911
from dspy.utils.callback import with_callbacks
10-
from dspy.clients.lm import LM
1112

1213

1314
class Predict(Module, Parameter):
@@ -80,7 +81,7 @@ def forward(self, **kwargs):
8081

8182
# Get the right LM to use.
8283
lm = kwargs.pop("lm", self.lm) or dspy.settings.lm
83-
assert isinstance(lm, dspy.LM), "No LM is loaded."
84+
assert isinstance(lm, BaseLM), "No LM is loaded."
8485

8586
# If temperature is 0.0 but its n > 1, set temperature to 0.7.
8687
temperature = config.get("temperature")

0 commit comments

Comments
 (0)