File size: 546 Bytes
8abba98
 
 
 
 
 
 
 
 
 
 
 
 
 
e049152
8abba98
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

from chitra.serve.app import GradioApp

tokenizer = AutoTokenizer.from_pretrained(
    "finiteautomata/beto-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained(
    "finiteautomata/beto-sentiment-analysis")
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)


app = GradioApp(
    "text-classification",
    model=classifier,
    desc="🤗 HuggingFace Sentiment Analysis Example with CHITRA"
)
app.run()