From c84359ebc817b67da1a179402abeb2a4d9b57782 Mon Sep 17 00:00:00 2001 From: ashna000 Date: Tue, 15 Oct 2024 18:55:13 +0530 Subject: [PATCH 1/2] Fix for https://github.com/instructlab/training/issues/254 Signed-off-by: ashna000 --- src/instructlab/training/multipack_sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instructlab/training/multipack_sampler.py b/src/instructlab/training/multipack_sampler.py index 71d1def2..85b5bc2a 100644 --- a/src/instructlab/training/multipack_sampler.py +++ b/src/instructlab/training/multipack_sampler.py @@ -76,7 +76,7 @@ def get_effective_samples_per_minibatch(num_tokens_per_gpu): padding=True, ) batches = sampler.generate_batches() - return len(dataset) / len(batches) + return len(dataset) / len(batches if len(batches) > 0 else None samples_per_gpu = samples_per_minibatch / num_gpus From 1a9678f2e14de9b461f620189fbb0aa58d0485ec Mon Sep 17 00:00:00 2001 From: ashna000 Date: Wed, 16 Oct 2024 11:10:12 +0530 Subject: [PATCH 2/2] Corrected the typo error Signed-off-by: ashna000 --- src/instructlab/training/multipack_sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instructlab/training/multipack_sampler.py b/src/instructlab/training/multipack_sampler.py index 85b5bc2a..6a6d854d 100644 --- a/src/instructlab/training/multipack_sampler.py +++ b/src/instructlab/training/multipack_sampler.py @@ -76,7 +76,7 @@ def get_effective_samples_per_minibatch(num_tokens_per_gpu): padding=True, ) batches = sampler.generate_batches() - return len(dataset) / len(batches if len(batches) > 0 else None + return len(dataset) / len(batches) if len(batches) > 0 else None samples_per_gpu = samples_per_minibatch / num_gpus