Hello,
I’ve been trying to use Ctranslate2 with the option “target_prefix”, but to no avail. I keep getting this error:
TypeError: translate_batch(): incompatible function arguments. The following argument types are supported:
1. (self: ctranslate2.translator.Translator, source: List[List[str]], target_prefix: Optional[List[Optional[List[str]]]] = None, *, max_batch_size: int = 0, batch_type: str = 'examples', beam_size: int = 2, num_hypotheses: int = 1, length_penalty: float = 0, coverage_penalty: float = 0, prefix_bias_beta: float = 0, allow_early_exit: bool = True, max_decoding_length: int = 250, min_decoding_length: int = 1, use_vmap: bool = False, normalize_scores: bool = False, return_scores: bool = False, return_attention: bool = False, return_alternatives: bool = False, sampling_topk: int = 1, sampling_temperature: float = 1, replace_unknowns: bool = False) -> list
and this is my piece of code:
translation_ob = translator.translate_batch(dfChunk['SourceTokenized'].values.tolist(), target_prefix=dfChunk['TargetTokenizedKnown'].values.tolist(), return_scores=predictScore, normalize_scores=True)
dfChunk is a dataframe.
I tried few things, but i’m always getting the same error. Help would be much appreciated!
Note: if I don’t use the target_prefix option, everything is working fine.
Best regards,
Samuel