assert that sample_count > 0, avoiding division by zero

This commit is contained in:
xaedes 2023-09-17 13:07:17 +02:00
parent ddf5ac257a
commit 151bfe9ee1
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

View file

@ -220,7 +220,7 @@ int64_t get_example_targets_batch(
bool separate_with_bos, bool separate_with_bos,
bool fill_with_next_samples bool fill_with_next_samples
) { ) {
GGML_ASSERT(samples_count > 0);
GGML_ASSERT(tokens_input->n_dims == 2); GGML_ASSERT(tokens_input->n_dims == 2);
GGML_ASSERT(target_probs->n_dims == 3); GGML_ASSERT(target_probs->n_dims == 3);
int64_t n_vocab = target_probs->ne[0]; int64_t n_vocab = target_probs->ne[0];