Instructions to use climatebert/netzero-reduction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use climatebert/netzero-reduction with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="climatebert/netzero-reduction")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("climatebert/netzero-reduction") model = AutoModelForSequenceClassification.from_pretrained("climatebert/netzero-reduction", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Commit ·
60a3ac7
1
Parent(s): bd107b6
Update README.md
Browse files
README.md
CHANGED
|
@@ -45,6 +45,7 @@ tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, max_len=512)
|
|
| 45 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
|
| 46 |
|
| 47 |
# See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
|
| 48 |
-
for out in tqdm(pipe(KeyDataset(dataset, "text"), padding=True, truncation=True)):
|
| 49 |
-
|
|
|
|
| 50 |
```
|
|
|
|
| 45 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
|
| 46 |
|
| 47 |
# See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
|
| 48 |
+
for i, out in enumerate(tqdm(pipe(KeyDataset(dataset, "text"), padding=True, truncation=True))):
|
| 49 |
+
print(dataset["text"][i])
|
| 50 |
+
print(out)
|
| 51 |
```
|