Skip to content

Commit 2713fdc

Browse files
committed
Minor fixes to variable names
Signed-off-by: Meet Patel <[email protected]>
1 parent 9ef972f commit 2713fdc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

QEfficient/finetune/utils/train_utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ def train(
311311
if train_config.enable_ddp:
312312
dist.all_reduce(accuracy, op=dist.ReduceOp.SUM)
313313
accuracy /= dist.get_world_size()
314-
train_metric = accuracy
314+
metric_val = accuracy
315315
else:
316-
train_metric = torch.exp(train_epoch_loss)
316+
metric_val = torch.exp(train_epoch_loss)
317317

318-
train_metric.append(float(train_metric))
318+
train_metric.append(float(metric_val))
319319
train_loss.append(float(train_epoch_loss))
320320

321321
# Update the learning rate as needed
@@ -356,11 +356,11 @@ def train(
356356
val_metric.append(float(eval_metric))
357357
if train_config.task_type == "seq_classification":
358358
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"
360360
)
361361
else:
362362
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"
364364
)
365365

366366
# Saving the results every epoch to plot later

0 commit comments

Comments
 (0)