Instructions to use mochodek/comment-bert-purpose with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mochodek/comment-bert-purpose with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mochodek/comment-bert-purpose")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("mochodek/comment-bert-purpose") model = AutoModelForSequenceClassification.from_pretrained("mochodek/comment-bert-purpose", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -24,7 +24,7 @@ encoded_input = tokenizer(text, return_tensors='pt')
|
|
| 24 |
|
| 25 |
output = model(**encoded_input)
|
| 26 |
|
| 27 |
-
scores = softmax(output.logits.
|
| 28 |
|
| 29 |
id2class[np.argmax(scores)]
|
| 30 |
|
|
|
|
| 24 |
|
| 25 |
output = model(**encoded_input)
|
| 26 |
|
| 27 |
+
scores = softmax(output.logits.detach().numpy())
|
| 28 |
|
| 29 |
id2class[np.argmax(scores)]
|
| 30 |
|