mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 04:14:38 +08:00
chore(mlx-lm): fix the number of validation batches configuration. (#752)
* chore: fix number of validation batches * clean up * address comment
This commit is contained in:
@@ -137,8 +137,11 @@ def evaluate(
|
||||
):
|
||||
all_losses = []
|
||||
ntokens = 0
|
||||
for it, batch in zip(
|
||||
range(num_batches),
|
||||
|
||||
index_iterator = iter(range(num_batches)) if num_batches != -1 else iter(int, 1)
|
||||
|
||||
for _, batch in zip(
|
||||
index_iterator,
|
||||
iterate_batches(
|
||||
dataset=dataset,
|
||||
tokenizer=tokenizer,
|
||||
|
Reference in New Issue
Block a user