Instructions to use DignityInDifference/keepmesane-en-v1.0-202607 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DignityInDifference/keepmesane-en-v1.0-202607 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DignityInDifference/keepmesane-en-v1.0-202607", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,013 Bytes
dbd8a1d 084be20 dbd8a1d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ---
language:
- en
license: apache-2.0
library_name: transformers
---
# English Text Classifier
This repository contains a runnable sequence-classification model for English text.
## Files Needed for Inference
- `config.json`
- `model.safetensors`
- `tokenizer.json`
- `tokenizer_config.json`
- `special_tokens_map.json`
## Minimal Usage
```python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_path = "."
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
model.eval()
texts = [
"I disagree with this argument, but the evidence is interesting.",
"You are awful and should leave.",
]
inputs = tokenizer(
texts,
padding=True,
truncation=True,
return_tensors="pt",
)
with torch.no_grad():
logits = model(**inputs).logits
scores = torch.sigmoid(logits)
print(scores.tolist())
```
The model returns a 14-dimensional score vector for each input text. |