Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Revert "add lm callback back (#8169)" (#8201)

TomuHiratae7955effdbc4
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py
index ede012e3a..00250318b 100644
--- a/dspy/clients/lm.py
+++ b/dspy/clients/lm.py
@@ -14,7 +14,7 @@ from dspy.clients.openai import OpenAIProvider
from dspy.clients.provider import Provider, TrainingJob
from dspy.clients.utils_finetune import TrainDataFormat
from dspy.dsp.utils.settings import settings
-from dspy.utils.callback import BaseCallback, with_callbacks
+from dspy.utils.callback import BaseCallback
from .base_lm import BaseLM
@@ -114,7 +114,6 @@ class LM(BaseLM):
return completion_fn, litellm_cache_args
- @with_callbacks
def forward(self, prompt=None, messages=None, **kwargs):
# Build the request.
cache = kwargs.pop("cache", self.cache)
@@ -136,7 +135,6 @@ class LM(BaseLM):
settings.usage_tracker.add_usage(self.model, dict(results.usage))
return results
- @with_callbacks
async def aforward(self, prompt=None, messages=None, **kwargs):
# Build the request.
cache = kwargs.pop("cache", self.cache)