DSPy: The framework for programming—not prompting—language models
Python
fix(dsp): AWS::max_new_token is redundant to LM::max_tokens
sysid59241d51840f
diff --git a/dsp/modules/aws_models.py b/dsp/modules/aws_models.pyindex 94b07cad4..4c8937404 100644--- a/dsp/modules/aws_models.py+++ b/dsp/modules/aws_models.py@@ -49,6 +49,9 @@ class AWSModel(LM):self._max_context_size: int = max_context_sizeself._max_new_tokens: int = max_new_tokens+ # make it consistent with equivalent LM::max_token+ self.kwargs["max_tokens"] = max_new_tokens+self.kwargs = {**self.kwargs,**kwargs,@@ -63,7 +66,7 @@ class AWSModel(LM):"""Call model, get generated input without the formatted prompt."""def _estimate_tokens(self, text: str) -> int:- return len(text)/CHARS2TOKENS+ return len(text) / CHARS2TOKENSdef _extract_input_parameters(self,