Skip to content

Commit a67095a

Browse files
author
hy
committed
if translate failed, return ''
1 parent a6b14e9 commit a67095a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

translate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def translate_batch(self, sentences, max_try=3, count=0):
2626
# sentences is list
2727
results = []
2828
if count >= max_try:
29-
return results
29+
return ['' for _ in range(len(sentences))]
3030
try:
3131
translations = self.translator.translate(sentences, dest=self.trg, src=self.src)
3232
for translation in translations:

0 commit comments

Comments
 (0)