Using 3.5.1
I am also trying to use the text classification pipeline. I trained my model using trainer and saved it to “path to saved model”.  My issue is that when I try to use the pipeline to predict, the call to the tokenizer is not truncating the result to the  “model_max_length” set in the configuration of my trained model/tokenizer. I initialize as below:
tokenizer = RobertaTokenizer.from_pretrained(“path to saved model”)
model = RobertaForSequenceClassification.from_pretrained(“path to saved model”)
classifier = pipeline(‘sentiment-analysis’, model=model,tokenizer=tokenizer)
Do I need to create my own pipeline subclassing the text classification one in order to force truncation?
Thanks