Add lm decode for the Python API. (#353)
* Add lm decode for the Python API. * fix style. * Fix LogAdd, Shouldn't double lm_log_prob when merge same prefix path * sort the import alphabetically
This commit is contained in:
@@ -17,11 +17,6 @@ void Hypotheses::Add(Hypothesis hyp) {
|
||||
hyps_dict_[key] = std::move(hyp);
|
||||
} else {
|
||||
it->second.log_prob = LogAdd<double>()(it->second.log_prob, hyp.log_prob);
|
||||
|
||||
if (it->second.lm_log_prob != 0 && hyp.lm_log_prob != 0) {
|
||||
it->second.lm_log_prob =
|
||||
LogAdd<double>()(it->second.lm_log_prob, hyp.lm_log_prob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user