File size: 328 Bytes
f858656
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from transformers import AutoModelForSequenceClassification

# Load your model
model = AutoModelForSequenceClassification.from_pretrained('path_to_your_local_model')

# Update label mapping
model.config.id2label = {0: 'Negative', 1: 'Neutral', 2: 'Positive'}
model.config.label2id = {'Negative': 0, 'Neutral': 1, 'Positive': 2}