From 151bfe9ee1b006cc266f4d5a65429aaeb660eb8d Mon Sep 17 00:00:00 2001 From: xaedes Date: Sun, 17 Sep 2023 13:07:17 +0200 Subject: [PATCH] assert that sample_count > 0, avoiding division by zero --- common/train.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/train.cpp b/common/train.cpp index fd34e026e..5edd5876e 100644 --- a/common/train.cpp +++ b/common/train.cpp @@ -220,7 +220,7 @@ int64_t get_example_targets_batch( bool separate_with_bos, bool fill_with_next_samples ) { - + GGML_ASSERT(samples_count > 0); GGML_ASSERT(tokens_input->n_dims == 2); GGML_ASSERT(target_probs->n_dims == 3); int64_t n_vocab = target_probs->ne[0];