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 @@ def print_green(self, text: str, end: str = "\n"): 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 @@ def inspect_history(self, n: int = 1, skip: int = 0): 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(