enio commited on
Commit
a4141e2
1 Parent(s): 17460f4

Create new file

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("sentiment", model="enio/Sentiment_BERT")
6
+
7
+ def predict(text):
8
+ return pipe(text)[0]["sentiment_text"]
9
+
10
+ iface = gr.Interface(
11
+ fn=predict,
12
+ inputs='text',
13
+ outputs='text',
14
+ examples=[["This is Awesome!"]]
15
+ )
16
+
17
+ iface.launch()