Views
No views yet
1from transformers import AutoTokenizer, AutoModel
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("your-username/emotion-classifier-deberta")
5model = AutoModel.from_pretrained("your-username/emotion-classifier-deberta")
6
7# Example usage
8text = "I'm so happy and excited about this!"
9inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
10with torch.no_grad():
11 outputs = model(**inputs)
12 predictions = torch.sigmoid(outputs.logits)