transformers.js
transformers.js copied to clipboard
Options for the "translation" pipeline when using Xenova/t5-small
Question
The translation pipeline is documented to use {src_lang and tgt_lang} options to translate from the src language to the tgt language. However, when using Xenova/t5-small none of the options seem to be used. Instead looking at the demo code it appears that you have to change the pipeline.task field to "translation_{fromLanguage}to{targetLanguage}" but I can't find a way to normalize the usage of the translation pipeline with different models.
Is this task pattern documented somewhere or am I missing some other option settings when calling the translation pipeline?