Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
|
2 |
+
|
3 |
+
from chitra.serve.app import GradioApp
|
4 |
+
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
6 |
+
"finiteautomata/beto-sentiment-analysis")
|
7 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
8 |
+
"finiteautomata/beto-sentiment-analysis")
|
9 |
+
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
10 |
+
|
11 |
+
|
12 |
+
app = GradioApp(
|
13 |
+
"text-classification",
|
14 |
+
model=classifier,
|
15 |
+
)
|
16 |
+
app.run()
|