File size: 801 Bytes
09ef976 0d014fc 12e1e0b 0d014fc 09ef976 | 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 | ---
language:
- en
library_name: transformers
pipeline_tag: token-classification
---
Currently Adding Token Classification to mistral model ;
Still need some kinks sorting out -on the way - Testing
```
! pip install flash_attn
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch
# Load pre-trained model and tokenizer
model_name = "LeroyDyer/Mixtral_AI_TokenClassification"
tokenizer = AutoTokenizer.from_pretrained("LeroyDyer/Mixtral_AI_PsycoTron")
model = AutoModelForTokenClassification.from_pretrained(model_name,
trust_remote_code=True,
num_labels=3)
model
model.train
# Get loss or logits
# loss = outputs.loss
# logits = outputs.logits
``` |