From f51ada866f9f4232d4bdb98b8356623234129107 Mon Sep 17 00:00:00 2001 From: Christian Risi <75698846+CnF-Gris@users.noreply.github.com> Date: Sun, 12 Oct 2025 00:13:03 +0200 Subject: [PATCH] Added verbosity level --- Playgrounds/nanosocrates-train-experiment-2.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Playgrounds/nanosocrates-train-experiment-2.py b/Playgrounds/nanosocrates-train-experiment-2.py index 31a68b8..fc5d811 100644 --- a/Playgrounds/nanosocrates-train-experiment-2.py +++ b/Playgrounds/nanosocrates-train-experiment-2.py @@ -51,6 +51,7 @@ VALIDATION_STEPS = 50 CHECKPOINT_STEPS = VALIDATION_STEPS * 4 PATIENCE = 4 CURRENT_EPOCH = 0 +VERBOSE = False SOS_TOKEN = TOKENANO.encode("")[0] @@ -125,7 +126,8 @@ while current_epoch < MAX_EPOCHS: batch_counter = 0 - print(f"EPOCH {current_epoch} STARTING") + if VERBOSE: + print(f"EPOCH {current_epoch} STARTING") for batch in TRAIN_BATCHER.batch(MINI_BATCH_SIZE): @@ -146,7 +148,8 @@ while current_epoch < MAX_EPOCHS: dec_x[:, 1:] = tgt[:, :-1] dec_x_pad = dec_x.eq(PAD_TOKEN) - print(f"\tBATCH {batch_counter} Starting") + if VERBOSE: + print(f"\tBATCH {batch_counter} Starting") # Task 1 and Task 2 if tasktype == Batch.TaskType.RDF2TXT or tasktype == Batch.TaskType.TEXT2RDF: @@ -173,7 +176,8 @@ while current_epoch < MAX_EPOCHS: # Task 3 if tasktype == Batch.TaskType.MASKING: - print(f"\tExecuting TASK 3 - BATCH {batch_counter}") + if VERBOSE: + print(f"\tExecuting TASK 3 - BATCH {batch_counter}") encoder_only_optim.zero_grad() @@ -192,7 +196,8 @@ while current_epoch < MAX_EPOCHS: # Task 4 if tasktype == Batch.TaskType.COMPLETATION: - print(f"\tExecuting TASK 4 - BATCH {batch_counter}") + if VERBOSE: + print(f"\tExecuting TASK 4 - BATCH {batch_counter}") decoder_only_optim.zero_grad()