Different results for the same mrm8488/t5-base-finetuned-emotion

I’m using mrm8488/t5-base-finetuned-emotion for emotion recognition.

The problem is that for the text input “Arigato AKIRA. Thanks Japan :heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart:”,

On model page’s hosted inference API, I get “joy”, which is correct.

But when I run the model on Colab, I get “anger” for both models provided in the documentation (AutoModelWithLMHead and AutoModelForSeq2SeqLM)

What is happening and how can I fix this?

Here is the link to colab

I actually realized that simply using pipeline solves the problem.
I guess the problme was caused by model and tokenizer?

Any insight or advice would still be appreciated!

from transformers import pipeline
classifier = pipeline("text2text-generation", model="mrm8488/t5-base-finetuned-emotion")
classifier("Arigato AKIRA. Thanks Japan  ❤️❤️❤️❤️❤️❤️❤️❤️♥️♥️♥️♥️♥️♥️♥️")
# Outputs: [{'generated_text': 'joy'}]