From 78b24a2375bb84408b2ca71172e3f0c68afb245e Mon Sep 17 00:00:00 2001 From: Chime Ogbuji Date: Sun, 3 Nov 2024 20:36:55 -0500 Subject: [PATCH] Fix index calculation --- llms/mlx_lm/tuner/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llms/mlx_lm/tuner/datasets.py b/llms/mlx_lm/tuner/datasets.py index 1a86fb9f..da2e6f22 100644 --- a/llms/mlx_lm/tuner/datasets.py +++ b/llms/mlx_lm/tuner/datasets.py @@ -94,7 +94,7 @@ class CompletionsDatasetCollection: while True: try: - if (curr_idx + 1) < len(item): + if (curr_idx + 1) <= len(item): return item[curr_idx] else: curr_idx -= len(item)