Spaces:
Sleeping
Sleeping
Commit
·
08831e4
1
Parent(s):
1961c08
Change to sentiment analysis
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
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()
|