From fba44bec8f754e0a17c7bbc76d50697121bf97a3 Mon Sep 17 00:00:00 2001 From: Jerin Philip Date: Wed, 17 Feb 2021 01:05:20 +0000 Subject: [PATCH] Improving Batcher error message with new option names --- src/translator/batcher.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/translator/batcher.cpp b/src/translator/batcher.cpp index 3a384d4..f671ffc 100644 --- a/src/translator/batcher.cpp +++ b/src/translator/batcher.cpp @@ -9,10 +9,9 @@ namespace bergamot { Batcher::Batcher(Ptr options) { miniBatchWords = options->get("mini-batch-words"); bucket_.resize(options->get("max-length-break") + 1); - ABORT_IF( - miniBatchWords < bucket_.size() - 1, - "max-input-tokens cannot be less than than max-input-sentence-tokens, " - "batcher fail"); + ABORT_IF(bucket_.size() - 1 > miniBatchWords, + "Fatal: max-length-break > mini-batch-words will lead to sentences " + "longer than what can fit in a batch."); } void Batcher::addSentenceWithPriority(RequestSentence &sentence) {