Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Correction for lm.py

Omar Khattab46f73224bcf8
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.py
index 3925e83b3..13ddfbffa 100644
--- a/dsp/modules/lm.py
+++ b/dsp/modules/lm.py
@@ -29,7 +29,7 @@ class LM(ABC):
import dspy
if dspy.settings.experimental:
- return "\n\n" + "\x1b[32m" + str(text) + "\x1b[0m" + end
+ return "\n\n" + "\x1b[32m" + str(text).lstrip() + "\x1b[0m" + end
else:
return "\x1b[32m" + str(text) + "\x1b[0m" + end
@@ -118,7 +118,7 @@ class LM(ABC):
text = choices[0]
else:
text = choices[0]["text"]
- printing_value += self.print_green(text.lstrip(), end="")
+ printing_value += self.print_green(text, end="")
if len(choices) > 1 and isinstance(choices, list):
printing_value += self.print_red(