mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 01:41:19 +08:00
LoRA: report last train info (#595)
This commit is contained in:
parent
4680ef4413
commit
39d5ca6427
@ -224,7 +224,7 @@ def train(
|
|||||||
n_tokens += toks.item()
|
n_tokens += toks.item()
|
||||||
|
|
||||||
# Report training loss if needed
|
# Report training loss if needed
|
||||||
if (it + 1) % args.steps_per_report == 0:
|
if ((it + 1) % args.steps_per_report == 0) or (it + 1 == args.iters):
|
||||||
train_loss = np.mean(losses)
|
train_loss = np.mean(losses)
|
||||||
|
|
||||||
stop = time.perf_counter()
|
stop = time.perf_counter()
|
||||||
@ -259,7 +259,7 @@ def train(
|
|||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
|
|
||||||
# Report validation loss if needed
|
# Report validation loss if needed
|
||||||
if it == 0 or (it + 1) % args.steps_per_eval == 0:
|
if it == 0 or ((it + 1) % args.steps_per_eval == 0) or (it + 1 == args.iters):
|
||||||
stop = time.perf_counter()
|
stop = time.perf_counter()
|
||||||
val_loss = evaluate(
|
val_loss = evaluate(
|
||||||
model=model,
|
model=model,
|
||||||
|
Loading…
Reference in New Issue
Block a user