Skip to content

Commit

Permalink
Logging: Add newlines to Prompt and Response
Browse files Browse the repository at this point in the history
Makes things clearer rather than adding an extra space.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Dec 23, 2023
1 parent 80ef379 commit 98a7b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gen_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ def log_generation_params(**kwargs):
def log_prompt(prompt: str):
"""Logs the prompt to console."""
if CONFIG.prompt:
logger.info(f"Prompt: {prompt if prompt else 'Empty'}\n")
formatted_prompt = "\n" + prompt
logger.info(f"Prompt: {formatted_prompt if prompt else 'Empty'}\n")


def log_response(response: str):
"""Logs the response to console."""
if CONFIG.prompt:
logger.info(f"Response: {response if response else 'Empty'}\n")
formatted_response = "\n" + response
logger.info(f"Response: {formatted_response if response else 'Empty'}\n")

0 comments on commit 98a7b95

Please sign in to comment.