|
--- |
|
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 |
|
|
|
|
|
|
|
``` |