from transformers import AutoModelForSequenceClassification
model_name = "nlptown/bert-base-multilingual-uncased-sentiment"
pt_model = AutoModelForSequenceClassification.from_pretrained(model_name)

See the task summary for tasks supported by an [AutoModel] class.

Now pass your preprocessed batch of inputs directly to the model. You just have to unpack the dictionary by adding **:

pt_outputs = pt_model(**pt_batch)