From b8a0b3f9256e7450244f70b2024703dd60ec7249 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 7 Jan 2024 10:35:55 -0800 Subject: [PATCH] Don't print torch tensors with --verbose --- modules/text_generation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/text_generation.py b/modules/text_generation.py index 295b0dc..74edc6f 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -346,7 +346,8 @@ def generate_reply_HF(question, original_question, seed, state, stopping_strings if shared.args.verbose: logger.info("GENERATE_PARAMS=") - pprint.PrettyPrinter(indent=4, sort_dicts=False).pprint(generate_params) + filtered_params = {key: value for key, value in generate_params.items() if not isinstance(value, torch.Tensor)} + pprint.PrettyPrinter(indent=4, sort_dicts=False).pprint(filtered_params) print() t0 = time.time()