File tree 1 file changed +5
-5
lines changed
QEfficient/finetune/utils
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -311,11 +311,11 @@ def train(
311
311
if train_config .enable_ddp :
312
312
dist .all_reduce (accuracy , op = dist .ReduceOp .SUM )
313
313
accuracy /= dist .get_world_size ()
314
- train_metric = accuracy
314
+ metric_val = accuracy
315
315
else :
316
- train_metric = torch .exp (train_epoch_loss )
316
+ metric_val = torch .exp (train_epoch_loss )
317
317
318
- train_metric .append (float (train_metric ))
318
+ train_metric .append (float (metric_val ))
319
319
train_loss .append (float (train_epoch_loss ))
320
320
321
321
# Update the learning rate as needed
@@ -356,11 +356,11 @@ def train(
356
356
val_metric .append (float (eval_metric ))
357
357
if train_config .task_type == "seq_classification" :
358
358
print (
359
- f"Epoch { epoch + 1 } : train_acc={ train_metric :.4f} , train_epoch_loss={ train_epoch_loss :.4f} , epoch time { epoch_end_time } s"
359
+ f"Epoch { epoch + 1 } : train_acc={ metric_val :.4f} , train_epoch_loss={ train_epoch_loss :.4f} , epoch time { epoch_end_time } s"
360
360
)
361
361
else :
362
362
print (
363
- f"Epoch { epoch + 1 } : train_metric={ train_metric :.4f} , train_epoch_loss={ train_epoch_loss :.4f} , epoch time { epoch_end_time } s"
363
+ f"Epoch { epoch + 1 } : train_metric={ metric_val :.4f} , train_epoch_loss={ train_epoch_loss :.4f} , epoch time { epoch_end_time } s"
364
364
)
365
365
366
366
# Saving the results every epoch to plot later
You can’t perform that action at this time.
0 commit comments