title: How to truncate input in the Huggingface pipeline?
body: <p>I currently use a huggingface pipeline for sentiment-analysis like so:</p>
  <pre><code>from transformers import pipeline
  classifier = pipeline('sentiment-analysis', device=0)
  </code></pre>
  <p>The problem is that when I pass texts larger than 512 tokens, it just crashes saying that the input is too long.  Is there any way of passing the max_length and truncate parameters from the tokenizer directly to the pipeline?</p>
  <p>My work around is to do:</p>
  <p>from transformers import AutoTokenizer, AutoModelForSequenceClassification</p>
  <pre><code>model_name = &quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
  tokenizer = AutoTokenizer.from_pretrained(model_name)
  classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer, device=0)
  </code></pre>
  <p>And then when I call the tokenizer:</p>
  <pre><code>pt_batch = tokenizer(text, padding=True, truncation=True, max_length=512, return_tensors=&quot;pt&quot;)
  </code></pre>
  <p>But it would be much nicer to simply be able to call the pipeline directly like so:</p>
  <pre><code>classifier(text, padding=True, truncation=True, max_length=512)
  </code></pre>