Instructions to use KevSun/Personality_LM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KevSun/Personality_LM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KevSun/Personality_LM")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KevSun/Personality_LM") model = AutoModelForSequenceClassification.from_pretrained("KevSun/Personality_LM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -54,10 +54,10 @@ model.eval() # Set the model to evaluation mode
|
|
| 54 |
with torch.no_grad():
|
| 55 |
outputs = model(**encoded_input)
|
| 56 |
|
| 57 |
-
predictions = outputs.logits.squeeze()
|
| 58 |
|
| 59 |
-
|
| 60 |
-
predicted_scores = predictions.
|
|
|
|
| 61 |
|
| 62 |
trait_names = ["Agreeableness", "Openness", "Conscientiousness", "Extraversion", "Neuroticism"]
|
| 63 |
|
|
|
|
| 54 |
with torch.no_grad():
|
| 55 |
outputs = model(**encoded_input)
|
| 56 |
|
|
|
|
| 57 |
|
| 58 |
+
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
| 59 |
+
predicted_scores = predictions[0].tolist()
|
| 60 |
+
|
| 61 |
|
| 62 |
trait_names = ["Agreeableness", "Openness", "Conscientiousness", "Extraversion", "Neuroticism"]
|
| 63 |
|