winain7788 commited on
Commit
08831e4
·
1 Parent(s): 1961c08

Change to sentiment analysis

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,7 +1,11 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  demo.launch()
 
1
  import gradio as gr
2
+ from transformers_js_py import pipeline
3
 
4
+ pipe = pipeline('sentiment-analysis')
5
+
6
+ async def process(text):
7
+ return await pipe(text)
8
+
9
+ demo = gr.Interface(fn=process, inputs="text", outputs="json")
10
 
 
11
  demo.launch()