diff options
author | Guillaume Klein <guillaume.klein@systrangroup.com> | 2017-10-20 12:33:38 +0300 |
---|---|---|
committer | Guillaume Klein <guillaume.klein@systrangroup.com> | 2017-10-20 12:33:38 +0300 |
commit | 60b81f812451451c25c40651c4e3feb8c95953d7 (patch) | |
tree | 206942a5dfab8fa9777cedc5ce04c8830ae36460 /onmt | |
parent | f445f4251aef9623ec476d93663f07f64fa0cb80 (diff) |
Fix error on empty input vector during translation
Diffstat (limited to 'onmt')
-rw-r--r-- | onmt/translate/Translator.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/onmt/translate/Translator.lua b/onmt/translate/Translator.lua index 9b67cd9c..e064624e 100644 --- a/onmt/translate/Translator.lua +++ b/onmt/translate/Translator.lua @@ -231,7 +231,8 @@ function Translator:buildData(src, gold) local index = 1 for b = 1, #src do - if src[b].words and #src[b].words == 0 then + if (src[b].words and #src[b].words == 0 + or src[b].vectors and src[b].vectors:dim() == 0) then table.insert(ignored, b) else indexMap[index] = b |