Skip to content

Commit e236f00

Browse files
committed
correct position of decode args
1 parent 3ed2b81 commit e236f00

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hf_hub_ctranslate2/translate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def _forward(self, *args, **kwds):
117117
def tokenize_decode(self, tokens_out, *args, **kwargs):
118118
return [
119119
self.tokenizer.decode(
120-
self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0], *args, **kwargs)
120+
self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0]),
121+
*args, **kwargs
121122
)
122123
for i in range(len(tokens_out))
123124
]
@@ -210,7 +211,8 @@ def tokenize_encode(self, text, *args, **kwargs):
210211
def tokenize_decode(self, tokens_out, *args, **kwargs):
211212
return [
212213
self.tokenizer.decode(
213-
self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0][1:], *args, **kwargs)
214+
self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0][1:]),
215+
*args, **kwargs
214216
)
215217
for i in range(len(tokens_out))
216218
]

0 commit comments

Comments
 (0)