elozano commited on
Commit
e567dcc
1 Parent(s): 4b1cd4e

Limit generated sequences

Browse files
Files changed (1) hide show
  1. pipeline.py +1 -1
pipeline.py CHANGED
@@ -13,5 +13,5 @@ class NewsPipeline(TextClassificationPipeline):
13
  text = f" {self.tokenizer.sep_token} ".join([headline, content])
14
  else:
15
  text = headline
16
- prediction = super().__call__(text)[0]
17
  return {**prediction, "emoji": self.emojis[prediction["label"]]}
 
13
  text = f" {self.tokenizer.sep_token} ".join([headline, content])
14
  else:
15
  text = headline
16
+ prediction = super().__call__(text, padding=True, truncation=True)[0]
17
  return {**prediction, "emoji": self.emojis[prediction["label"]]}