Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
Currently Adding Token Classification to mistral model ;
|
| 4 |
+
|
| 5 |
+
Still need some kinks sorting out -on the way - Testing
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
| 10 |
+
import torch
|
| 11 |
+
|
| 12 |
+
# Load pre-trained model and tokenizer
|
| 13 |
+
model_name = "LeroyDyer/Mixtral_AI_TokenClassification"
|
| 14 |
+
tokenizer = AutoTokenizer.from_pretrained("LeroyDyer/Mixtral_AI_PsycoTron")
|
| 15 |
+
model = AutoModelForTokenClassification.from_pretrained(model_name,
|
| 16 |
+
trust_remote_code=True,
|
| 17 |
+
num_labels=3)
|
| 18 |
+
model
|
| 19 |
+
model.train
|
| 20 |
+
|
| 21 |
+
# Get loss or logits
|
| 22 |
+
# loss = outputs.loss
|
| 23 |
+
# logits = outputs.logits
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
```
|