mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-11 11:48:39 +08:00
fix Test
This commit is contained in:
parent
1beefd58a0
commit
43940ec673
@ -287,16 +287,16 @@ def evaluate_model(args, model: nn.Module, tokenizer: TokenizerWrapper, test_set
|
|||||||
model.eval()
|
model.eval()
|
||||||
|
|
||||||
if args.training_mode == "orpo":
|
if args.training_mode == "orpo":
|
||||||
test_loss, test_rewards = evaluate_orpo(
|
test_loss, test_rewards, _, _ = evaluate_orpo(
|
||||||
model=model,
|
model=model,
|
||||||
dataset=test_set,
|
dataset=test_set,
|
||||||
tokenizer=tokenizer,
|
|
||||||
batch_size=args.batch_size,
|
batch_size=args.batch_size,
|
||||||
num_batches=args.test_batches,
|
num_batches=args.test_batches,
|
||||||
max_seq_length=args.max_seq_length,
|
max_seq_length=args.max_seq_length,
|
||||||
beta=args.beta
|
beta=args.beta
|
||||||
)
|
)
|
||||||
print(f"Test loss {test_loss:.3f}, Rewards: {test_rewards[0]:.3f}, {test_rewards[1]:.3f}")
|
test_ppl = math.exp(test_loss)
|
||||||
|
print(f"Test loss {test_loss:.3f}, Test ppl {test_ppl:.3f}, Rewards: {test_rewards[0]:.3f}, {test_rewards[1]:.3f}")
|
||||||
else:
|
else:
|
||||||
test_loss = evaluate(
|
test_loss = evaluate(
|
||||||
model=model,
|
model=model,
|
||||||
|
Loading…
Reference in New Issue
Block a user