diff --git a/hf_hub_ctranslate2/translate.py b/hf_hub_ctranslate2/translate.py index 7256aab..ffe5b84 100644 --- a/hf_hub_ctranslate2/translate.py +++ b/hf_hub_ctranslate2/translate.py @@ -117,7 +117,8 @@ def _forward(self, *args, **kwds): def tokenize_decode(self, tokens_out, *args, **kwargs): return [ self.tokenizer.decode( - self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0], *args, **kwargs) + self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0]), + *args, **kwargs ) for i in range(len(tokens_out)) ] @@ -210,7 +211,8 @@ def tokenize_encode(self, text, *args, **kwargs): def tokenize_decode(self, tokens_out, *args, **kwargs): return [ self.tokenizer.decode( - self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0][1:], *args, **kwargs) + self.tokenizer.convert_tokens_to_ids(tokens_out[i].hypotheses[0][1:]), + *args, **kwargs ) for i in range(len(tokens_out)) ]