Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model = pipeline(model="seara/rubert-tiny2-ru-go-emotions")
|
5 |
+
|
6 |
+
def text_classification(data):
|
7 |
+
result = model(data)[0]['label']
|
8 |
+
return result
|
9 |
+
|
10 |
+
demo = gr.Interface(fn=text_classification, inputs="textbox", outputs="textbox")
|
11 |
+
|
12 |
+
demo.launch(share=True)
|