update
Browse files
run_distillation_nodes.py
CHANGED
@@ -771,7 +771,11 @@ def save_hf_weights(
|
|
771 |
|
772 |
def write_train_metric(summary_writer, train_metrics, train_time, step, logging_steps):
|
773 |
summary_writer.scalar("train/time", train_time, step)
|
774 |
-
|
|
|
|
|
|
|
|
|
775 |
train_metrics = get_metrics(train_metrics)
|
776 |
for key, vals in train_metrics.items():
|
777 |
steps_arr = np.arange(0, step, logging_steps)[-len(vals) :]
|
|
|
771 |
|
772 |
def write_train_metric(summary_writer, train_metrics, train_time, step, logging_steps):
|
773 |
summary_writer.scalar("train/time", train_time, step)
|
774 |
+
# Check if train_metrics is empty
|
775 |
+
if not train_metrics:
|
776 |
+
print("DEBUG: train_metrics is empty; This is probably a bug that needs fixing.")
|
777 |
+
return # Early exit if train_metrics is empty to avoid further processing
|
778 |
+
|
779 |
train_metrics = get_metrics(train_metrics)
|
780 |
for key, vals in train_metrics.items():
|
781 |
steps_arr = np.arange(0, step, logging_steps)[-len(vals) :]
|