Lord-Raven commited on
Commit
5f09d1f
·
1 Parent(s): e4a8953

Trying pipeline.

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -1,3 +1,16 @@
1
- import gradio as gr
2
 
3
- gr.load("models/SamLowe/roberta-base-go_emotions").launch(share=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()