doublelotus commited on
Commit
3e4b279
·
1 Parent(s): 2592bac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -1,15 +1,9 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
  classifier = pipeline("sentiment-analysis")
5
-
6
- def predict(text):
7
  return classifier(text)
8
 
9
- demo = gr.Interface(
10
- fn=predict,
11
- inputs='text',
12
- outputs='text',
13
- )
14
-
15
- demo.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
  classifier = pipeline("sentiment-analysis")
5
+ def sentimental(text):
 
6
  return classifier(text)
7
 
8
+ iface = gr.Interface(fn=sentimental, inputs="text", outputs="text")
9
+ iface.launch()