File size: 451 Bytes
1d7f96c
0108425
1d7f96c
 
 
 
0108425
1d7f96c
 
 
 
 
 
0108425
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from transformers import AutoTokenizer, AutoModelForSequenceClassification

# Correctly load the tokenizer and model
model_name = "ai4bharat/indic-bert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Example usage
input_text = "This is a sample sentence for classification."
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model(**inputs)

print(outputs)