Lord-Raven commited on
Commit ·
5f09d1f
1
Parent(s): e4a8953
Trying pipeline.
Browse files
app.py
CHANGED
|
@@ -1,3 +1,16 @@
|
|
| 1 |
-
import gradio as
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as
|
| 2 |
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions")
|
| 6 |
+
|
| 7 |
+
def predict(text):
|
| 8 |
+
return classifier(text)
|
| 9 |
+
|
| 10 |
+
demo = gr.Interface(
|
| 11 |
+
fn=predict,
|
| 12 |
+
inputs='text',
|
| 13 |
+
outputs='result',
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
demo.launch()
|