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
|
Download README.md from DignityInDifference/keepmesane-en-v1.0-202607: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/DignityInDifference/keepmesane-en-v1.0-202607/resolve/main/README.md
- Command line
-
hf download hf://DignityInDifference/keepmesane-en-v1.0-202607/README.md
-
curl -L -o README.md https://huggingface.co/DignityInDifference/keepmesane-en-v1.0-202607/resolve/main/README.md
1.01 kB
| --- | |
| 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. |