Don't print torch tensors with --verbose

This commit is contained in:
oobabooga 2024-01-07 10:35:55 -08:00
parent cf820c69c5
commit b8a0b3f925

View File

@ -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()