Views
No views yet
1from transformers import AutoTokenizer, AutoModel
2import torch
3
4# Load the model and tokenizer
5tokenizer = AutoTokenizer.from_pretrained("soheil-mp/EmoBERT")
6model = BertModel.from_pretrained("soheil-mp/EmoBERT")
7
8# Prepare input
9text = "I'm so excited about the upcoming concert!"
10inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
11
12# Get predictions
13outputs = model(**inputs)