Text Classification
Transformers
PyTorch
English
roberta
climate
Inference Endpoints
kdutia commited on
Commit
7aa98b4
1 Parent(s): c1b1a66

add padding and truncation arguments to `pipe` example

Browse files

based on feedback that the current example doesn't work for batch inference

Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -45,7 +45,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
45
  pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, function_to_apply="sigmoid")
46
 
47
 
48
- pipe(example)
49
 
50
  >>> [{'label': 'NZT', 'score': 0.9142044186592102}]
51
  ```
 
45
  pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, function_to_apply="sigmoid")
46
 
47
 
48
+ pipe(example, padding=True, truncation=True)
49
 
50
  >>> [{'label': 'NZT', 'score': 0.9142044186592102}]
51
  ```