From 46f73224bcf83bff99431d2c9daa48ab972b3fbe Mon Sep 17 00:00:00 2001 From: Omar Khattab Date: Sat, 6 Jul 2024 16:11:29 -0700 Subject: [PATCH] Correction for lm.py --- dsp/modules/lm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(