Malai / app.py
Shanaman987's picture
Update app.py
1d7f96c verified
raw
history blame
451 Bytes
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)