Skip to content

Commit

Permalink
Fix data_iter in prepare_dataset from speechcommands example (ml-expl…
Browse files Browse the repository at this point in the history
  • Loading branch information
sakares authored and mokeddembillel committed Dec 16, 2024
1 parent a0e7965 commit a73de93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions speechcommands/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def step(x, y):
samples_per_sec = []

model.train(True)
train_iter.reset()
for batch_counter, batch in enumerate(train_iter):
x = mx.array(batch["audio"])
y = mx.array(batch["label"])
Expand Down Expand Up @@ -111,6 +112,7 @@ def test_epoch(model, test_iter):
model.train(False)
accs = []
throughput = []
test_iter.reset()
for batch_counter, batch in enumerate(test_iter):
x = mx.array(batch["audio"])
y = mx.array(batch["label"])
Expand Down

0 comments on commit a73de93

Please sign in to comment.