Skip to content

Commit

Permalink
Fixed minor float check bug in compute_num_steps_per_epoch (#235)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Egert <degert@nvidia.com>
  • Loading branch information
trias702 committed Jul 12, 2024
1 parent 2a454f9 commit 23752e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nemo_aligner/utils/trainer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def compute_num_steps_per_epoch(

num_steps_per_epoch = sampler.total_samples // sampler.global_batch_size

if limit_train_batches is None or limit_train_batches > 1.0:
if limit_train_batches is None or (isinstance(limit_train_batches, float) and limit_train_batches > 1.0):
limit_train_batches = 1.0

if limit_train_batches >= 0:
Expand Down

0 comments on commit 23752e7

Please sign in to comment.