MBART-50 looks not compatible with pipeline
I am usingfacebook/mbart-large-50-many-to-many-mmtmodel to translate texts in different directions.Using generate, it looks that the model works fine. However, using pipeline the model return random tokens.from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
    article_en = "When you have a medical appointment, your health provider writes notes on the visit that are available to you"
    article_fr = "Les infirmières praticiennes et infirmiers praticiens sont des membres du personnel infirmier autorisé qui possèdent une formation et une expérience plus poussées et qui peuvent poser un diagnostic"
    model = MBartForConditionalGeneration.from_pretrained(
        "facebook/mbart-large-50-many-to-many-mmt")
    tokenizer = MBart50TokenizerFast.from_pretrained(
        "facebook/mbart-large-50-many-to-many-mmt")
    # using generate
    tokenizer.src_lang = "en_XX"
    encoded_ar = tokenizer(article_en, return_tensors="pt")
    generated_tokens = model.generate(
        **encoded_ar,
        forced_bos_token_id=tokenizer.lang_code_to_id["fr_XX"],
        max_length=512
    )
    pred = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
  # it returns:
 ['Lorsque vous avez un rendez-vous médical, votre professionnel de la santé vous envoie des notes sur la visite qui vous sont disponibles.']
    print(pred, "\n", "-"*30) 

    transl = pipeline(task="translation_en_to_fr",
                      model=model, tokenizer=tokenizer, device=0, src_lang="en_XX", tgt_lang="fr_XX",
                      generation_kwargs={"skip_special_tokens": True,
                                         "forced_bos_token_id": tokenizer.lang_code_to_id["fr_XX"]})

    pred = transl(article_en)

    print(pred)
[{'translation_text': 'fr http http http http http'}]