From 2dadf42cb5252e50ef4ab62249d14d9636e8bae0 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 30 Jan 2023 08:29:49 -0300 Subject: [PATCH] Print the tokenized example dialogue in a prettier way --- server.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 65810370..4efac0c0 100644 --- a/server.py +++ b/server.py @@ -519,10 +519,14 @@ if args.chat or args.cai_chat: _history.append(entry) entry = ['', ''] - print(f"\nDialogue tokenized to (formatted as [question, reply]):\n\n", end='') - for i in _history: - print(i) - print("--------------------\n", end='') + print(f"\033[1;32;1m\nDialogue tokenized to:\033[0;37;0m\n", end='') + for row in _history: + for column in row: + print("\n") + for line in column.strip().split('\n'): + print("| "+line+"\n") + print("|\n") + print("------------------------------") return _history