Add a warning message for an incorrect use of output sampling (#585)

Add a warning message if sampling with beam-size > 1 or ensembles
This commit is contained in:
Roman Grundkiewicz 2020-01-31 14:22:21 +00:00 committed by GitHub
parent 533604024b
commit 990aeb5daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,17 @@ public:
threadPool.enqueue(task, device, id++);
}
if(options_->get<bool>("output-sampling", false)) {
if(options_->get<size_t>("beam-size") > 1)
LOG(warn,
"[warning] Output sampling and beam search (beam-size > 1) are contradictory methods "
"and using them together is not recommended. Set beam-size to 1");
if(options_->get<std::vector<std::string>>("models").size() > 1)
LOG(warn,
"[warning] Output sampling and model ensembling are contradictory methods and using "
"them together is not recommended. Use a single model");
}
}
void run() override {